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:
parent
4d39fba931
commit
4c05c2833c
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue