Update vendor for k8s.io/utils
This commit is contained in:
parent
9268b49cf4
commit
3de6f883fe
24
vendor/k8s.io/utils/mount/mount_helper_unix.go
generated
vendored
24
vendor/k8s.io/utils/mount/mount_helper_unix.go
generated
vendored
@ -61,8 +61,12 @@ type MountInfo struct {
|
|||||||
ID int
|
ID int
|
||||||
// The ID of the parent mount (or of self for the root of this mount namespace's mount tree).
|
// The ID of the parent mount (or of self for the root of this mount namespace's mount tree).
|
||||||
ParentID int
|
ParentID int
|
||||||
// The value of `st_dev` for files on this filesystem.
|
// Major indicates one half of the device ID which identifies the device class
|
||||||
MajorMinor string
|
// (parsed from `st_dev` for files on this filesystem).
|
||||||
|
Major int
|
||||||
|
// Minor indicates one half of the device ID which identifies a specific
|
||||||
|
// instance of device (parsed from `st_dev` for files on this filesystem).
|
||||||
|
Minor int
|
||||||
// The pathname of the directory in the filesystem which forms the root of this mount.
|
// The pathname of the directory in the filesystem which forms the root of this mount.
|
||||||
Root string
|
Root string
|
||||||
// Mount source, filesystem-specific information. e.g. device, tmpfs name.
|
// Mount source, filesystem-specific information. e.g. device, tmpfs name.
|
||||||
@ -106,10 +110,24 @@ func ParseMountInfo(filename string) ([]MountInfo, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
mm := strings.Split(fields[2], ":")
|
||||||
|
if len(mm) != 2 {
|
||||||
|
return nil, fmt.Errorf("parsing '%s' failed: unexpected minor:major pair %s", line, mm)
|
||||||
|
}
|
||||||
|
major, err := strconv.Atoi(mm[0])
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("parsing '%s' failed: unable to parse major device id, err:%v", mm[0], err)
|
||||||
|
}
|
||||||
|
minor, err := strconv.Atoi(mm[1])
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("parsing '%s' failed: unable to parse minor device id, err:%v", mm[1], err)
|
||||||
|
}
|
||||||
|
|
||||||
info := MountInfo{
|
info := MountInfo{
|
||||||
ID: id,
|
ID: id,
|
||||||
ParentID: parentID,
|
ParentID: parentID,
|
||||||
MajorMinor: fields[2],
|
Major: major,
|
||||||
|
Minor: minor,
|
||||||
Root: fields[3],
|
Root: fields[3],
|
||||||
MountPoint: fields[4],
|
MountPoint: fields[4],
|
||||||
MountOptions: strings.Split(fields[5], ","),
|
MountOptions: strings.Split(fields[5], ","),
|
||||||
|
10
vendor/k8s.io/utils/mount/mount_linux.go
generated
vendored
10
vendor/k8s.io/utils/mount/mount_linux.go
generated
vendored
@ -499,7 +499,8 @@ func SearchMountPoints(hostSource, mountInfoPath string) ([]string, error) {
|
|||||||
|
|
||||||
mountID := 0
|
mountID := 0
|
||||||
rootPath := ""
|
rootPath := ""
|
||||||
majorMinor := ""
|
major := -1
|
||||||
|
minor := -1
|
||||||
|
|
||||||
// Finding the underlying root path and major:minor if possible.
|
// Finding the underlying root path and major:minor if possible.
|
||||||
// We need search in backward order because it's possible for later mounts
|
// We need search in backward order because it's possible for later mounts
|
||||||
@ -509,12 +510,13 @@ func SearchMountPoints(hostSource, mountInfoPath string) ([]string, error) {
|
|||||||
// If it's a mount point or path under a mount point.
|
// If it's a mount point or path under a mount point.
|
||||||
mountID = mis[i].ID
|
mountID = mis[i].ID
|
||||||
rootPath = filepath.Join(mis[i].Root, strings.TrimPrefix(hostSource, mis[i].MountPoint))
|
rootPath = filepath.Join(mis[i].Root, strings.TrimPrefix(hostSource, mis[i].MountPoint))
|
||||||
majorMinor = mis[i].MajorMinor
|
major = mis[i].Major
|
||||||
|
minor = mis[i].Minor
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if rootPath == "" || majorMinor == "" {
|
if rootPath == "" || major == -1 || minor == -1 {
|
||||||
return nil, fmt.Errorf("failed to get root path and major:minor for %s", hostSource)
|
return nil, fmt.Errorf("failed to get root path and major:minor for %s", hostSource)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,7 +526,7 @@ func SearchMountPoints(hostSource, mountInfoPath string) ([]string, error) {
|
|||||||
// Ignore mount entry for mount source itself.
|
// Ignore mount entry for mount source itself.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if mis[i].Root == rootPath && mis[i].MajorMinor == majorMinor {
|
if mis[i].Root == rootPath && mis[i].Major == major && mis[i].Minor == minor {
|
||||||
refs = append(refs, mis[i].MountPoint)
|
refs = append(refs, mis[i].MountPoint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -311,7 +311,7 @@ gopkg.in/olivere/elastic.v2/uritemplates
|
|||||||
gopkg.in/yaml.v2
|
gopkg.in/yaml.v2
|
||||||
# k8s.io/klog v0.3.0
|
# k8s.io/klog v0.3.0
|
||||||
k8s.io/klog
|
k8s.io/klog
|
||||||
# k8s.io/utils v0.0.0-20200117235808-5f6fbceb4c31
|
# k8s.io/utils v0.0.0-20200122174043-1e243dd1a584
|
||||||
k8s.io/utils/clock
|
k8s.io/utils/clock
|
||||||
k8s.io/utils/clock/testing
|
k8s.io/utils/clock/testing
|
||||||
k8s.io/utils/exec
|
k8s.io/utils/exec
|
||||||
|
Loading…
Reference in New Issue
Block a user