mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix: naming typos (#3327)
fix: naming typos Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
parent
7232de45c6
commit
8cc883becc
3 changed files with 10 additions and 10 deletions
|
@ -221,7 +221,7 @@ func applyCommandHelper(resourcePaths []string, cluster bool, policyReport bool,
|
|||
}
|
||||
}
|
||||
|
||||
mutatedPolicies, err := common.MutatePolices(policies)
|
||||
mutatedPolicies, err := common.MutatePolicies(policies)
|
||||
if err != nil {
|
||||
if !sanitizederror.IsErrorSanitized(err) {
|
||||
return rc, resources, skipInvalidPolicies, pvInfos, sanitizederror.NewWithError("failed to mutate policy", err)
|
||||
|
|
|
@ -415,7 +415,7 @@ func GetVariable(variablesString, valuesFile string, fs billy.Filesystem, isGit
|
|||
fmt.Printf(("\nNOTICE: request.object.* variables are automatically parsed from the supplied resource. Ignoring value of variables `%v`.\n"), reqObjVars)
|
||||
}
|
||||
|
||||
storePolices := make([]store.Policy, 0)
|
||||
storePolicies := make([]store.Policy, 0)
|
||||
for policyName, ruleMap := range valuesMapRule {
|
||||
storeRules := make([]store.Rule, 0)
|
||||
for _, rule := range ruleMap {
|
||||
|
@ -424,21 +424,21 @@ func GetVariable(variablesString, valuesFile string, fs billy.Filesystem, isGit
|
|||
Values: rule.Values,
|
||||
})
|
||||
}
|
||||
storePolices = append(storePolices, store.Policy{
|
||||
storePolicies = append(storePolicies, store.Policy{
|
||||
Name: policyName,
|
||||
Rules: storeRules,
|
||||
})
|
||||
}
|
||||
|
||||
store.SetContext(store.Context{
|
||||
Policies: storePolices,
|
||||
Policies: storePolicies,
|
||||
})
|
||||
|
||||
return variables, globalValMap, valuesMapResource, namespaceSelectorMap, nil
|
||||
}
|
||||
|
||||
// MutatePolices - function to apply mutation on policies
|
||||
func MutatePolices(policies []*v1.ClusterPolicy) ([]*v1.ClusterPolicy, error) {
|
||||
// MutatePolicies - function to apply mutation on policies
|
||||
func MutatePolicies(policies []*v1.ClusterPolicy) ([]*v1.ClusterPolicy, error) {
|
||||
newPolicies := make([]*v1.ClusterPolicy, 0)
|
||||
logger := log.Log.WithName("apply")
|
||||
|
||||
|
@ -854,7 +854,7 @@ func processGenerateEngineResponse(policy *v1.ClusterPolicy, generateResponse *r
|
|||
}
|
||||
|
||||
func SetInStoreContext(mutatedPolicies []*v1.ClusterPolicy, variables map[string]string) map[string]string {
|
||||
storePolices := make([]store.Policy, 0)
|
||||
storePolicies := make([]store.Policy, 0)
|
||||
for _, policy := range mutatedPolicies {
|
||||
storeRules := make([]store.Rule, 0)
|
||||
for _, rule := range policy.Spec.Rules {
|
||||
|
@ -874,14 +874,14 @@ func SetInStoreContext(mutatedPolicies []*v1.ClusterPolicy, variables map[string
|
|||
})
|
||||
}
|
||||
}
|
||||
storePolices = append(storePolices, store.Policy{
|
||||
storePolicies = append(storePolicies, store.Policy{
|
||||
Name: policy.Name,
|
||||
Rules: storeRules,
|
||||
})
|
||||
}
|
||||
|
||||
store.SetContext(store.Context{
|
||||
Policies: storePolices,
|
||||
Policies: storePolicies,
|
||||
})
|
||||
|
||||
return variables
|
||||
|
|
|
@ -701,7 +701,7 @@ func applyPoliciesFromPath(fs billy.Filesystem, policyBytes []byte, valuesFile s
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
mutatedPolicies, err := common.MutatePolices(policies)
|
||||
mutatedPolicies, err := common.MutatePolicies(policies)
|
||||
if err != nil {
|
||||
if !sanitizederror.IsErrorSanitized(err) {
|
||||
return sanitizederror.NewWithError("failed to mutate policy", err)
|
||||
|
|
Loading…
Add table
Reference in a new issue