mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #78888 from tedyu/mount-ref
Return early when mount ref is determined
This commit is contained in:
commit
3ee8ae2721
@ -313,13 +313,12 @@ func checkForNetDev(options []string) bool {
|
|||||||
// Plan to work on better approach to solve this issue.
|
// Plan to work on better approach to solve this issue.
|
||||||
|
|
||||||
func HasMountRefs(mountPath string, mountRefs []string) bool {
|
func HasMountRefs(mountPath string, mountRefs []string) bool {
|
||||||
count := 0
|
|
||||||
for _, ref := range mountRefs {
|
for _, ref := range mountRefs {
|
||||||
if !strings.Contains(ref, mountPath) {
|
if !strings.Contains(ref, mountPath) {
|
||||||
count = count + 1
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count > 0
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// PathWithinBase checks if give path is within given base directory.
|
// PathWithinBase checks if give path is within given base directory.
|
||||||
|
Loading…
Reference in New Issue
Block a user