vendor: update moby/sys for darwin support
The mount package of darwin requires to retrive mountinfo to check if the target of unmount if still mounted or not. Thus pull the upstreamed version of moby/sys to support this operation. Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
This commit is contained in:
parent
45e0e5a77e
commit
b8f3ebb03b
2
go.mod
2
go.mod
@ -38,7 +38,7 @@ require (
|
||||
github.com/imdario/mergo v0.3.12
|
||||
github.com/klauspost/compress v1.11.13
|
||||
github.com/moby/locker v1.0.1
|
||||
github.com/moby/sys/mountinfo v0.4.1
|
||||
github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201
|
||||
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879
|
||||
github.com/moby/sys/symlink v0.1.0
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
|
3
go.sum
3
go.sum
@ -394,8 +394,9 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
|
||||
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
|
||||
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
|
||||
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
|
||||
github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM=
|
||||
github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
|
||||
github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201 h1:3CCeKh7+WeRmAJdVR2aNruVqoRbHQ4UIq91gPnGdNrY=
|
||||
github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
|
||||
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 h1:PkXi3ZKVBSfi1skhCjUykUKRwKxn/D48Nj4D1sWalXk=
|
||||
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879/go.mod h1:JwObcMnOrUy2VTP5swPKWwywH0Mbgk8Y5qua9iwtIRM=
|
||||
github.com/moby/sys/symlink v0.1.0 h1:MTFZ74KtNI6qQQpuBxU+uKCim4WtOMokr03hCfJcazE=
|
||||
|
@ -369,8 +369,9 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
|
||||
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
|
||||
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
|
||||
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
|
||||
github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM=
|
||||
github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
|
||||
github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201 h1:3CCeKh7+WeRmAJdVR2aNruVqoRbHQ4UIq91gPnGdNrY=
|
||||
github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
|
||||
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 h1:PkXi3ZKVBSfi1skhCjUykUKRwKxn/D48Nj4D1sWalXk=
|
||||
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879/go.mod h1:JwObcMnOrUy2VTP5swPKWwywH0Mbgk8Y5qua9iwtIRM=
|
||||
github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ=
|
||||
|
2
vendor/github.com/moby/sys/mountinfo/mounted_unix.go
generated
vendored
2
vendor/github.com/moby/sys/mountinfo/mounted_unix.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// +build linux freebsd,cgo openbsd,cgo
|
||||
// +build linux freebsd,cgo openbsd,cgo darwin,cgo
|
||||
|
||||
package mountinfo
|
||||
|
||||
|
4
vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go
generated
vendored
4
vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// +build freebsd,cgo openbsd,cgo
|
||||
// +build freebsd,cgo openbsd,cgo darwin,cgo
|
||||
|
||||
package mountinfo
|
||||
|
||||
@ -21,7 +21,7 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) {
|
||||
|
||||
count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT))
|
||||
if count == 0 {
|
||||
return nil, fmt.Errorf("Failed to call getmntinfo")
|
||||
return nil, fmt.Errorf("failed to call getmntinfo")
|
||||
}
|
||||
|
||||
var entries []C.struct_statfs
|
||||
|
27
vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
generated
vendored
27
vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
generated
vendored
@ -52,7 +52,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
|
||||
numFields := len(fields)
|
||||
if numFields < 10 {
|
||||
// should be at least 10 fields
|
||||
return nil, fmt.Errorf("Parsing '%s' failed: not enough fields (%d)", text, numFields)
|
||||
return nil, fmt.Errorf("parsing '%s' failed: not enough fields (%d)", text, numFields)
|
||||
}
|
||||
|
||||
// separator field
|
||||
@ -67,7 +67,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
|
||||
for fields[sepIdx] != "-" {
|
||||
sepIdx--
|
||||
if sepIdx == 5 {
|
||||
return nil, fmt.Errorf("Parsing '%s' failed: missing - separator", text)
|
||||
return nil, fmt.Errorf("parsing '%s' failed: missing - separator", text)
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,46 +75,39 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
|
||||
|
||||
p.Mountpoint, err = unescape(fields[4])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Parsing '%s' failed: mount point: %w", fields[4], err)
|
||||
return nil, fmt.Errorf("parsing '%s' failed: mount point: %w", fields[4], err)
|
||||
}
|
||||
p.FSType, err = unescape(fields[sepIdx+1])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Parsing '%s' failed: fstype: %w", fields[sepIdx+1], err)
|
||||
return nil, fmt.Errorf("parsing '%s' failed: fstype: %w", fields[sepIdx+1], err)
|
||||
}
|
||||
p.Source, err = unescape(fields[sepIdx+2])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Parsing '%s' failed: source: %w", fields[sepIdx+2], err)
|
||||
return nil, fmt.Errorf("parsing '%s' failed: source: %w", fields[sepIdx+2], err)
|
||||
}
|
||||
p.VFSOptions = fields[sepIdx+3]
|
||||
|
||||
// ignore any numbers parsing errors, as there should not be any
|
||||
p.ID, _ = strconv.Atoi(fields[0])
|
||||
p.Parent, _ = strconv.Atoi(fields[1])
|
||||
mm := strings.Split(fields[2], ":")
|
||||
mm := strings.SplitN(fields[2], ":", 3)
|
||||
if len(mm) != 2 {
|
||||
return nil, fmt.Errorf("Parsing '%s' failed: unexpected minor:major pair %s", text, mm)
|
||||
return nil, fmt.Errorf("parsing '%s' failed: unexpected major:minor pair %s", text, mm)
|
||||
}
|
||||
p.Major, _ = strconv.Atoi(mm[0])
|
||||
p.Minor, _ = strconv.Atoi(mm[1])
|
||||
|
||||
p.Root, err = unescape(fields[3])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Parsing '%s' failed: root: %w", fields[3], err)
|
||||
return nil, fmt.Errorf("parsing '%s' failed: root: %w", fields[3], err)
|
||||
}
|
||||
|
||||
p.Options = fields[5]
|
||||
|
||||
// zero or more optional fields
|
||||
switch {
|
||||
case sepIdx == 6:
|
||||
// zero, do nothing
|
||||
case sepIdx == 7:
|
||||
p.Optional = fields[6]
|
||||
default:
|
||||
p.Optional = strings.Join(fields[6:sepIdx-1], " ")
|
||||
}
|
||||
p.Optional = strings.Join(fields[6:sepIdx], " ")
|
||||
|
||||
// Run the filter after parsing all of the fields.
|
||||
// Run the filter after parsing all fields.
|
||||
var skip, stop bool
|
||||
if filter != nil {
|
||||
skip, stop = filter(p)
|
||||
|
2
vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go
generated
vendored
2
vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// +build !windows,!linux,!freebsd,!openbsd freebsd,!cgo openbsd,!cgo
|
||||
// +build !windows,!linux,!freebsd,!openbsd,!darwin freebsd,!cgo openbsd,!cgo darwin,!cgo
|
||||
|
||||
package mountinfo
|
||||
|
||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -285,7 +285,7 @@ github.com/moby/locker
|
||||
# github.com/moby/spdystream v0.2.0
|
||||
github.com/moby/spdystream
|
||||
github.com/moby/spdystream/spdy
|
||||
# github.com/moby/sys/mountinfo v0.4.1
|
||||
# github.com/moby/sys/mountinfo v0.4.2-0.20211022201527-95edfa939201
|
||||
## explicit
|
||||
github.com/moby/sys/mountinfo
|
||||
# github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879
|
||||
|
Loading…
Reference in New Issue
Block a user