mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: update kubernetes dep to 1.24.0
As kubernetes 1.24.0 is released, updating kubernetes dependencies to 1.24.0 updates: #3086 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
fc1529f268
commit
c4f79d455f
18
vendor/k8s.io/mount-utils/mount_helper_unix.go
generated
vendored
18
vendor/k8s.io/mount-utils/mount_helper_unix.go
generated
vendored
@ -136,7 +136,7 @@ func ParseMountInfo(filename string) ([]MountInfo, error) {
|
||||
Minor: minor,
|
||||
Root: fields[3],
|
||||
MountPoint: fields[4],
|
||||
MountOptions: strings.Split(fields[5], ","),
|
||||
MountOptions: splitMountOptions(fields[5]),
|
||||
}
|
||||
// All fields until "-" are "optional fields".
|
||||
i := 6
|
||||
@ -150,12 +150,26 @@ func ParseMountInfo(filename string) ([]MountInfo, error) {
|
||||
}
|
||||
info.FsType = fields[i]
|
||||
info.Source = fields[i+1]
|
||||
info.SuperOptions = strings.Split(fields[i+2], ",")
|
||||
info.SuperOptions = splitMountOptions(fields[i+2])
|
||||
infos = append(infos, info)
|
||||
}
|
||||
return infos, nil
|
||||
}
|
||||
|
||||
// splitMountOptions parses comma-separated list of mount options into an array.
|
||||
// It respects double quotes - commas in them are not considered as the option separator.
|
||||
func splitMountOptions(s string) []string {
|
||||
inQuotes := false
|
||||
list := strings.FieldsFunc(s, func(r rune) bool {
|
||||
if r == '"' {
|
||||
inQuotes = !inQuotes
|
||||
}
|
||||
// Report a new field only when outside of double quotes.
|
||||
return r == ',' && !inQuotes
|
||||
})
|
||||
return list
|
||||
}
|
||||
|
||||
// isMountPointMatch returns true if the path in mp is the same as dir.
|
||||
// Handles case where mountpoint dir has been renamed due to stale NFS mount.
|
||||
func isMountPointMatch(mp MountPoint, dir string) bool {
|
||||
|
Reference in New Issue
Block a user