Merge pull request #78888 from tedyu/mount-ref

Return early when mount ref is determined
This commit is contained in:
Kubernetes Prow Robot
2019-06-17 04:36:50 -07:00
committed by GitHub

View File

@@ -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.