Fix skipped policy message is displayed even if variable is passed
@@ -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 {
