mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 10:28:36 +00:00
update comment for bug_268
This commit is contained in:
parent
87994e4a77
commit
15092f6927
1 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue