Merge pull request #54558 from sttts/sttts-fix-zero-case-import-verifier

Automatic merge from submit-queue (batch tested with PRs 54537, 54558). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

importverifier: fix isPathUnder for base == path

isPathUnder returned false for base == path, but should return true.
This commit is contained in:
Kubernetes Submit Queue 2017-10-25 06:20:08 -07:00 committed by GitHub
commit 94acd5a076

View File

@ -110,7 +110,7 @@ func isPathUnder(base, path string) (bool, error) {
// if path is below base, the relative path
// from base to path will not start with `../`
return !strings.HasPrefix(relPath, "."), nil
return !strings.HasPrefix(relPath, ".."), nil
}
// forbiddenImportsFor determines all of the forbidden