1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

744 policy validation skip

This commit is contained in:
shravan 2020-04-23 01:05:00 +05:30
parent 34238188da
commit 7dc7420ad9
3 changed files with 4 additions and 14 deletions

View file

@ -94,7 +94,7 @@ func validateResource(log logr.Logger, ctx context.EvalInterface, policy kyverno
if rule.Validation.Deny != nil {
denyConditionsCopy := copyConditions(rule.Validation.Deny.Conditions)
if rule.Validation.Deny.AllRequests || !variables.EvaluateConditions(log, ctx, denyConditionsCopy) {
if rule.Validation.Deny.AllRequests || variables.EvaluateConditions(log, ctx, denyConditionsCopy) {
ruleResp := response.RuleResponse{
Name: rule.Name,
Type: utils.Validation.String(),

View file

@ -55,9 +55,9 @@ func Validate(policyRaw []byte, client *dclient.Client, mock bool, openAPIContro
return fmt.Errorf("path: spec.rules[%d]: %v", i, err)
}
if doesMatchAndExcludeConflict(rule) {
return fmt.Errorf("path: spec.rules[%v]: rule is matching an empty set", rule.Name)
}
//if doesMatchAndExcludeConflict(rule) {
// return fmt.Errorf("path: spec.rules[%v]: rule is matching an empty set", rule.Name)
//}
// validate rule actions
// - Mutate

View file

@ -262,11 +262,6 @@ func (ws *WebhookServer) resourceMutation(request *v1beta1.AdmissionRequest) *v1
if err != nil {
logger.Error(err, "failed to load incoming request in context")
}
// load incoming resource into the context
err = ctx.AddResource(request.Object.Raw)
if err != nil {
logger.Error(err, "failed to load incoming resource in context")
}
err = ctx.AddUserInfo(userRequestInfo)
if err != nil {
@ -360,11 +355,6 @@ func (ws *WebhookServer) resourceValidation(request *v1beta1.AdmissionRequest) *
if err != nil {
logger.Error(err, "failed to load incoming request in context")
}
// load incoming resource into the context
err = ctx.AddResource(request.Object.Raw)
if err != nil {
logger.Error(err, "failed to load incoming resource in context")
}
err = ctx.AddUserInfo(userRequestInfo)
if err != nil {