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
commit 3ee8ae2721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,13 +313,12 @@ func checkForNetDev(options []string) bool {
// Plan to work on better approach to solve this issue.
func HasMountRefs(mountPath string, mountRefs []string) bool {
count := 0
for _, ref := range mountRefs {
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.