1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00

fix: support fully-qualified file paths in cli test command (#8163)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-08-29 19:08:20 +02:00 committed by GitHub
parent 4d39fba931
commit 4c05c2833c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -255,11 +255,13 @@ func applyPoliciesFromPath(
func getFullPath(paths []string, policyResourcePath string, isGit bool) []string { func getFullPath(paths []string, policyResourcePath string, isGit bool) []string {
var pols []string var pols []string
var pol string
if !isGit { if !isGit {
for _, path := range paths { for _, path := range paths {
pol = filepath.Join(policyResourcePath, path) if !filepath.IsAbs(path) {
pols = append(pols, pol) pols = append(pols, filepath.Join(policyResourcePath, path))
} else {
pols = append(pols, path)
}
} }
return pols return pols
} }