mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
removed comments
This commit is contained in:
parent
afe98bb93c
commit
11e73381cf
2 changed files with 0 additions and 18 deletions
|
@ -68,11 +68,6 @@ func GetPolicies(paths []string) (policies []*v1.ClusterPolicy, error error) {
|
|||
}
|
||||
}
|
||||
|
||||
// for i := range policies {
|
||||
// setFalse := false
|
||||
// policies[i].Spec.Background = &setFalse
|
||||
// }
|
||||
|
||||
return policies, nil
|
||||
}
|
||||
|
||||
|
@ -150,13 +145,6 @@ func GetPoliciesValidation(policyPaths []string) ([]*v1.ClusterPolicy, *openapi.
|
|||
return policies, openAPIController, nil
|
||||
}
|
||||
|
||||
// PolicyHasVariables - check for variables in policy
|
||||
// func PolicyHasVariables(policy v1.ClusterPolicy) bool {
|
||||
// policyRaw, _ := json.Marshal(policy)
|
||||
// regex := regexp.MustCompile(`\{\{([^{}]*)\}\}`)
|
||||
// return len(regex.FindAllStringSubmatch(string(policyRaw), -1)) > 0
|
||||
// }
|
||||
|
||||
// MutatePolicy - applies mutation to a policy
|
||||
func MutatePolicy(policy *v1.ClusterPolicy, logger logr.Logger) (*v1.ClusterPolicy, error) {
|
||||
patches, _ := policymutation.GenerateJSONPatchesForDefaults(policy, logger)
|
||||
|
|
|
@ -49,12 +49,6 @@ func Command() *cobra.Command {
|
|||
|
||||
invalidPolicyFound := false
|
||||
for _, policy := range policies {
|
||||
// if common.PolicyHasVariables(*policy) {
|
||||
// invalidPolicyFound = true
|
||||
// fmt.Printf("Policy %s is invalid.\n", policy.Name)
|
||||
// log.Log.Error(errors.New("'validate' does not support policies with variables"), "Policy "+policy.Name+" is invalid")
|
||||
// continue
|
||||
// }
|
||||
err := policy2.Validate(utils.MarshalPolicy(*policy), nil, true, openAPIController)
|
||||
if err != nil {
|
||||
fmt.Printf("Policy %s is invalid.\n", policy.Name)
|
||||
|
|
Loading…
Add table
Reference in a new issue