diff --git a/pkg/engine/generation.go b/pkg/engine/generation.go index 314646fe72..d0e0c73c7d 100644 --- a/pkg/engine/generation.go +++ b/pkg/engine/generation.go @@ -79,16 +79,16 @@ func applyRuleGenerator(client *client.Client, ns unstructured.Unstructured, gen resource.SetNamespace(ns.GetName()) // Reset resource version resource.SetResourceVersion("") - - if validationFailureAction != "audit" { - // if not audit, then enforce.. - // with enforce we will block the creation of resource and instead generate an error - // the error will then create a policyViolation so that the resource owner can add the defaults - return errors.New("policy flag validationFailureAction:'audit' blocked the creation of default resource for the namespace") - } + // TODO based on https://github.com/nirmata/kyverno/issues/268 + // if validationFailureAction != "audit" { + // // if not audit, then enforce.. + // // with enforce we will block the creation of resource and instead generate an error + // // the error will then create a policyViolation so that the resource owner can add the defaults + // return errors.New("policy flag validationFailureAction:'audit' blocked the creation of default resource for the namespace") + // } // for "audit" mode, the resource will create the resource // but wont generate a policy violation as the generate controller doesnt know if the generate request - // is a new resource via admission controller or via syncing its cache after a controller restart + // is a new resource via admission controller or via syncing its cache after a controller _, err = client.CreateResource(gen.Kind, ns.GetName(), resource, false) if err != nil { return err