1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 10:04:25 +00:00

Fix skipped policy message is displayed even if variable is passed ()

This commit is contained in:
Vyankatesh Kudtarkar 2021-09-28 19:06:16 +05:30 committed by GitHub
parent 6a81bb7cc3
commit 5273a7fa7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -334,7 +334,7 @@ func applyPoliciesFromPath(fs billy.Filesystem, policyBytes []byte, valuesFile s
}
fmt.Printf("\nExecuting %s...", values.Name)
valuesFile = values.Variables
variables, globalValMap, valuesMap, namespaceSelectorMap, err := common.GetVariable(variablesString, values.Variables, fs, isGit, policyResourcePath)
if err != nil {
if !sanitizederror.IsErrorSanitized(err) {
@ -384,9 +384,6 @@ func applyPoliciesFromPath(fs billy.Filesystem, policyBytes []byte, valuesFile s
fmt.Printf("\napplying %s to %s... \n", msgPolicies, msgResources)
}
if variablesString != "" {
variables = common.SetInStoreContext(mutatedPolicies, variables)
}
for _, policy := range mutatedPolicies {
err := policy2.Validate(policy, nil, true, openAPIController)
if err != nil {