mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +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 {
|
||||
var pols []string
|
||||
var pol string
|
||||
if !isGit {
|
||||
for _, path := range paths {
|
||||
pol = filepath.Join(policyResourcePath, path)
|
||||
pols = append(pols, pol)
|
||||
if !filepath.IsAbs(path) {
|
||||
pols = append(pols, filepath.Join(policyResourcePath, path))
|
||||
} else {
|
||||
pols = append(pols, path)
|
||||
}
|
||||
}
|
||||
return pols
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue