Skip to content

Commit df7295d

Browse files
Update continuity, go-winio and hcsshim
Update dependencies and remove the local bindfilter files. Those have been moved to go-winio. Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent 0db78c4 commit df7295d

25 files changed

Lines changed: 267 additions & 352 deletions

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/containerd/btrfs/v2 v2.0.0
1313
github.com/containerd/cgroups/v3 v3.0.1
1414
github.com/containerd/console v1.0.3
15-
github.com/containerd/continuity v0.3.0
15+
github.com/containerd/continuity v0.3.1-0.20230206102841-68f7b34f5e11
1616
github.com/containerd/fifo v1.1.0
1717
github.com/containerd/go-cni v1.1.9
1818
github.com/containerd/go-runc v1.0.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR
233233
github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ=
234234
github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM=
235235
github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk=
236-
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
237-
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
236+
github.com/containerd/continuity v0.3.1-0.20230206102841-68f7b34f5e11 h1:NKxa3JMWvOvsU7ZgHwd9CZupl/692lPy/MBcumAAHsI=
237+
github.com/containerd/continuity v0.3.1-0.20230206102841-68f7b34f5e11/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
238238
github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
239239
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
240240
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=

integration/client/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ go 1.19
44

55
require (
66
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // replaced; see replace rules for actual version used.
7+
github.com/Microsoft/go-winio v0.6.1
78
github.com/Microsoft/hcsshim v0.10.0-rc.8
89
github.com/Microsoft/hcsshim/test v0.0.0-20210408205431-da33ecd607e1
910
github.com/containerd/cgroups/v3 v3.0.1
1011
github.com/containerd/containerd v1.7.0 // see replace; the actual version of containerd is replaced with the code at the root of this repository
11-
github.com/containerd/continuity v0.3.0
12+
github.com/containerd/continuity v0.3.1-0.20230206102841-68f7b34f5e11
1213
github.com/containerd/go-runc v1.0.0
1314
github.com/containerd/ttrpc v1.2.2
1415
github.com/containerd/typeurl/v2 v2.1.1
@@ -23,7 +24,6 @@ require (
2324

2425
require (
2526
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652 // indirect
26-
github.com/Microsoft/go-winio v0.6.1 // indirect
2727
github.com/cilium/ebpf v0.9.1 // indirect
2828
github.com/containerd/cgroups v1.1.0 // indirect
2929
github.com/containerd/console v1.0.3 // indirect

integration/client/go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,9 @@ github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8a
654654
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
655655
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
656656
github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ=
657-
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
658657
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
658+
github.com/containerd/continuity v0.3.1-0.20230206102841-68f7b34f5e11 h1:NKxa3JMWvOvsU7ZgHwd9CZupl/692lPy/MBcumAAHsI=
659+
github.com/containerd/continuity v0.3.1-0.20230206102841-68f7b34f5e11/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
659660
github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4=
660661
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
661662
github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=

integration/client/snapshot_windows_test.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
// +build windows
33

44
/*
5-
Copyright The containerd Authors.
5+
Copyright The containerd Authors.
66
7-
Licensed under the Apache License, Version 2.0 (the "License");
8-
you may not use this file except in compliance with the License.
9-
You may obtain a copy of the License at
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
1010
11-
http://www.apache.org/licenses/LICENSE-2.0
11+
http://www.apache.org/licenses/LICENSE-2.0
1212
13-
Unless required by applicable law or agreed to in writing, software
14-
distributed under the License is distributed on an "AS IS" BASIS,
15-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
See the License for the specific language governing permissions and
17-
limitations under the License.
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
1818
*/
19+
1920
package client
2021

2122
import (

mount/mount_windows.go

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ import (
2323
"os"
2424
"path/filepath"
2525
"strings"
26+
"syscall"
2627

28+
"github.com/Microsoft/go-winio/pkg/bindfilter"
2729
"github.com/Microsoft/hcsshim"
30+
"golang.org/x/sys/windows"
2831
)
2932

3033
const sourceStreamName = "containerd.io-source"
@@ -45,7 +48,7 @@ func (m *Mount) mount(target string) error {
4548
}
4649

4750
if m.Type == "bind" {
48-
if err := ApplyFileBinding(target, m.Source, readOnly); err != nil {
51+
if err := bindfilter.ApplyFileBinding(target, m.Source, readOnly); err != nil {
4952
return fmt.Errorf("failed to bind-mount to %s: %w", target, err)
5053
}
5154
return nil
@@ -89,12 +92,12 @@ func (m *Mount) mount(target string) error {
8992
return fmt.Errorf("failed to get volume path for layer %s: %w", m.Source, err)
9093
}
9194

92-
if err = ApplyFileBinding(target, volume, readOnly); err != nil {
95+
if err = bindfilter.ApplyFileBinding(target, volume, readOnly); err != nil {
9396
return fmt.Errorf("failed to set volume mount path for layer %s: %w", m.Source, err)
9497
}
9598
defer func() {
9699
if err != nil {
97-
RemoveFileBinding(target)
100+
bindfilter.RemoveFileBinding(target)
98101
}
99102
}()
100103

@@ -128,29 +131,7 @@ func (m *Mount) GetParentPaths() ([]string, error) {
128131

129132
// Unmount the mount at the provided path
130133
func Unmount(mount string, flags int) error {
131-
var err error
132134
mount = filepath.Clean(mount)
133-
// This should expand paths like ADMINI~1 and PROGRA~1 to long names.
134-
mount, err = getFinalPath(mount)
135-
if err != nil {
136-
return fmt.Errorf("fetching real path: %w", err)
137-
}
138-
mounts, err := GetBindMappings(mount)
139-
if err != nil {
140-
return fmt.Errorf("fetching bind mappings: %w", err)
141-
}
142-
found := false
143-
for _, mnt := range mounts {
144-
if mnt.MountPoint == mount {
145-
found = true
146-
break
147-
}
148-
}
149-
if !found {
150-
// not a mount point
151-
return nil
152-
}
153-
154135
adsFile := mount + ":" + sourceStreamName
155136
var layerPath string
156137

@@ -162,7 +143,11 @@ func Unmount(mount string, flags int) error {
162143
layerPath = string(layerPathb)
163144
}
164145

165-
if err := RemoveFileBinding(mount); err != nil {
146+
if err := bindfilter.RemoveFileBinding(mount); err != nil {
147+
if errno, ok := errors.Unwrap(err).(syscall.Errno); ok && errno == windows.ERROR_INVALID_PARAMETER {
148+
// not a mount point
149+
return nil
150+
}
166151
return fmt.Errorf("removing mount: %w", err)
167152
}
168153

mount/volumemountutils_windows.go

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)