diff --git a/api/kyverno/v1/clusterpolicy_types.go b/api/kyverno/v1/clusterpolicy_types.go index dc5ac75a7f..a3cef4dea1 100644 --- a/api/kyverno/v1/clusterpolicy_types.go +++ b/api/kyverno/v1/clusterpolicy_types.go @@ -14,15 +14,16 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:resource:path=clusterpolicies,scope="Cluster",shortName=cpol,categories=kyverno -// +kubebuilder:printcolumn:name="Background",type=boolean,JSONPath=".spec.background" -// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" -// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 -// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:printcolumn:name="Validate",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 -// +kubebuilder:printcolumn:name="Mutate",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 -// +kubebuilder:printcolumn:name="Generate",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 -// +kubebuilder:printcolumn:name="Verifyimages",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 +// +kubebuilder:printcolumn:name="ADMISSION",type=boolean,JSONPath=".spec.admission" +// +kubebuilder:printcolumn:name="BACKGROUND",type=boolean,JSONPath=".spec.background" +// +kubebuilder:printcolumn:name="VALIDATE ACTION",type=string,JSONPath=".spec.validationFailureAction" +// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="FAILURE POLICY",type=string,JSONPath=".spec.failurePolicy",priority=1 +// +kubebuilder:printcolumn:name="VALIDATE",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 +// +kubebuilder:printcolumn:name="MUTATE",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 +// +kubebuilder:printcolumn:name="GENERATE",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 +// +kubebuilder:printcolumn:name="VERIFY IMAGES",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 // +kubebuilder:printcolumn:name="MESSAGE",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].message` // +kubebuilder:storageversion @@ -79,6 +80,11 @@ func (p *ClusterPolicy) HasVerifyImages() bool { return p.Spec.HasVerifyImages() } +// AdmissionProcessingEnabled checks if admission is set to true +func (p *ClusterPolicy) AdmissionProcessingEnabled() bool { + return p.Spec.AdmissionProcessingEnabled() +} + // BackgroundProcessingEnabled checks if background is set to true func (p *ClusterPolicy) BackgroundProcessingEnabled() bool { return p.Spec.BackgroundProcessingEnabled() diff --git a/api/kyverno/v1/policy_interface.go b/api/kyverno/v1/policy_interface.go index f1c70cc71a..20658c2de6 100644 --- a/api/kyverno/v1/policy_interface.go +++ b/api/kyverno/v1/policy_interface.go @@ -10,6 +10,7 @@ import ( // +kubebuilder:object:generate=false type PolicyInterface interface { metav1.Object + AdmissionProcessingEnabled() bool BackgroundProcessingEnabled() bool IsNamespaced() bool GetSpec() *Spec diff --git a/api/kyverno/v1/policy_types.go b/api/kyverno/v1/policy_types.go index aed1110500..19be0bc05f 100644 --- a/api/kyverno/v1/policy_types.go +++ b/api/kyverno/v1/policy_types.go @@ -12,17 +12,18 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Background",type=boolean,JSONPath=".spec.background" -// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" -// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 -// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:printcolumn:name="Validate",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 -// +kubebuilder:printcolumn:name="Mutate",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 -// +kubebuilder:printcolumn:name="Generate",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 -// +kubebuilder:printcolumn:name="Verifyimages",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 -// +kubebuilder:resource:shortName=pol,categories=kyverno +// +kubebuilder:printcolumn:name="ADMISSION",type=boolean,JSONPath=".spec.admission" +// +kubebuilder:printcolumn:name="BACKGROUND",type=boolean,JSONPath=".spec.background" +// +kubebuilder:printcolumn:name="VALIDATE ACTION",type=string,JSONPath=".spec.validationFailureAction" +// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="FAILURE POLICY",type=string,JSONPath=".spec.failurePolicy",priority=1 +// +kubebuilder:printcolumn:name="VALIDATE",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 +// +kubebuilder:printcolumn:name="MUTATE",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 +// +kubebuilder:printcolumn:name="GENERATE",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 +// +kubebuilder:printcolumn:name="VERIFY IMAGES",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 // +kubebuilder:printcolumn:name="MESSAGE",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].message` +// +kubebuilder:resource:shortName=pol,categories=kyverno // +kubebuilder:storageversion // Policy declares validation, mutation, and generation behaviors for matching resources. @@ -80,6 +81,11 @@ func (p *Policy) HasVerifyImages() bool { return p.Spec.HasVerifyImages() } +// AdmissionProcessingEnabled checks if admission is set to true +func (p *Policy) AdmissionProcessingEnabled() bool { + return p.Spec.AdmissionProcessingEnabled() +} + // BackgroundProcessingEnabled checks if background is set to true func (p *Policy) BackgroundProcessingEnabled() bool { return p.Spec.BackgroundProcessingEnabled() diff --git a/api/kyverno/v1/spec_types.go b/api/kyverno/v1/spec_types.go index 30337f2159..973f50c336 100644 --- a/api/kyverno/v1/spec_types.go +++ b/api/kyverno/v1/spec_types.go @@ -80,6 +80,12 @@ type Spec struct { // +optional ValidationFailureActionOverrides []ValidationFailureActionOverride `json:"validationFailureActionOverrides,omitempty" yaml:"validationFailureActionOverrides,omitempty"` + // Admission controls if rules are applied during admission. + // Optional. Default value is "true". + // +optional + // +kubebuilder:default=true + Admission *bool `json:"admission,omitempty" yaml:"admission,omitempty"` + // Background controls if rules are applied to existing resources during a background scan. // Optional. Default value is "true". The value must be set to "false" if the policy rule // uses variables that are only available in the admission review request (e.g. user name). @@ -187,6 +193,15 @@ func (s *Spec) HasVerifyManifests() bool { return false } +// AdmissionProcessingEnabled checks if admission is set to true +func (s *Spec) AdmissionProcessingEnabled() bool { + if s.Admission == nil { + return true + } + + return *s.Admission +} + // BackgroundProcessingEnabled checks if background is set to true func (s *Spec) BackgroundProcessingEnabled() bool { if s.Background == nil { diff --git a/api/kyverno/v1/zz_generated.deepcopy.go b/api/kyverno/v1/zz_generated.deepcopy.go index b90e217696..d6254b806d 100755 --- a/api/kyverno/v1/zz_generated.deepcopy.go +++ b/api/kyverno/v1/zz_generated.deepcopy.go @@ -1296,6 +1296,11 @@ func (in *Spec) DeepCopyInto(out *Spec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Admission != nil { + in, out := &in.Admission, &out.Admission + *out = new(bool) + **out = **in + } if in.Background != nil { in, out := &in.Background, &out.Background *out = new(bool) diff --git a/api/kyverno/v2beta1/clusterpolicy_types.go b/api/kyverno/v2beta1/clusterpolicy_types.go index 739e5a3f67..0a5cf02b07 100644 --- a/api/kyverno/v2beta1/clusterpolicy_types.go +++ b/api/kyverno/v2beta1/clusterpolicy_types.go @@ -15,15 +15,16 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:resource:path=clusterpolicies,scope="Cluster",shortName=cpol,categories=kyverno -// +kubebuilder:printcolumn:name="Background",type=boolean,JSONPath=".spec.background" -// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" -// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 -// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:printcolumn:name="Validate",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 -// +kubebuilder:printcolumn:name="Mutate",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 -// +kubebuilder:printcolumn:name="Generate",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 -// +kubebuilder:printcolumn:name="Verifyimages",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 +// +kubebuilder:printcolumn:name="ADMISSION",type=boolean,JSONPath=".spec.admission" +// +kubebuilder:printcolumn:name="BACKGROUND",type=boolean,JSONPath=".spec.background" +// +kubebuilder:printcolumn:name="VALIDATE ACTION",type=string,JSONPath=".spec.validationFailureAction" +// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="FAILURE POLICY",type=string,JSONPath=".spec.failurePolicy",priority=1 +// +kubebuilder:printcolumn:name="VALIDATE",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 +// +kubebuilder:printcolumn:name="MUTATE",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 +// +kubebuilder:printcolumn:name="GENERATE",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 +// +kubebuilder:printcolumn:name="VERIFY IMAGES",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 // +kubebuilder:printcolumn:name="MESSAGE",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].message` // ClusterPolicy declares validation, mutation, and generation behaviors for matching resources. @@ -79,6 +80,11 @@ func (p *ClusterPolicy) HasVerifyImages() bool { return p.Spec.HasVerifyImages() } +// AdmissionProcessingEnabled checks if admission is set to true +func (p *ClusterPolicy) AdmissionProcessingEnabled() bool { + return p.Spec.AdmissionProcessingEnabled() +} + // BackgroundProcessingEnabled checks if background is set to true func (p *ClusterPolicy) BackgroundProcessingEnabled() bool { return p.Spec.BackgroundProcessingEnabled() diff --git a/api/kyverno/v2beta1/policy_types.go b/api/kyverno/v2beta1/policy_types.go index 1227427ba6..9add862433 100644 --- a/api/kyverno/v2beta1/policy_types.go +++ b/api/kyverno/v2beta1/policy_types.go @@ -13,15 +13,16 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Background",type=boolean,JSONPath=".spec.background" -// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" -// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 -// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:printcolumn:name="Validate",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 -// +kubebuilder:printcolumn:name="Mutate",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 -// +kubebuilder:printcolumn:name="Generate",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 -// +kubebuilder:printcolumn:name="Verifyimages",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 +// +kubebuilder:printcolumn:name="ADMISSION",type=boolean,JSONPath=".spec.admission" +// +kubebuilder:printcolumn:name="BACKGROUND",type=boolean,JSONPath=".spec.background" +// +kubebuilder:printcolumn:name="VALIDATE ACTION",type=string,JSONPath=".spec.validationFailureAction" +// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].status` +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="FAILURE POLICY",type=string,JSONPath=".spec.failurePolicy",priority=1 +// +kubebuilder:printcolumn:name="VALIDATE",type=integer,JSONPath=`.status.rulecount.validate`,priority=1 +// +kubebuilder:printcolumn:name="MUTATE",type=integer,JSONPath=`.status.rulecount.mutate`,priority=1 +// +kubebuilder:printcolumn:name="GENERATE",type=integer,JSONPath=`.status.rulecount.generate`,priority=1 +// +kubebuilder:printcolumn:name="VERIFY IMAGES",type=integer,JSONPath=`.status.rulecount.verifyimages`,priority=1 // +kubebuilder:printcolumn:name="MESSAGE",type=string,JSONPath=`.status.conditions[?(@.type == "Ready")].message` // +kubebuilder:resource:shortName=pol,categories=kyverno @@ -79,6 +80,11 @@ func (p *Policy) HasVerifyImages() bool { return p.Spec.HasVerifyImages() } +// AdmissionProcessingEnabled checks if admission is set to true +func (p *Policy) AdmissionProcessingEnabled() bool { + return p.Spec.AdmissionProcessingEnabled() +} + // BackgroundProcessingEnabled checks if background is set to true func (p *Policy) BackgroundProcessingEnabled() bool { return p.Spec.BackgroundProcessingEnabled() diff --git a/api/kyverno/v2beta1/spec_types.go b/api/kyverno/v2beta1/spec_types.go index 32009e79df..6478b75382 100644 --- a/api/kyverno/v2beta1/spec_types.go +++ b/api/kyverno/v2beta1/spec_types.go @@ -41,6 +41,12 @@ type Spec struct { // +optional ValidationFailureActionOverrides []kyvernov1.ValidationFailureActionOverride `json:"validationFailureActionOverrides,omitempty" yaml:"validationFailureActionOverrides,omitempty"` + // Admission controls if rules are applied during admission. + // Optional. Default value is "true". + // +optional + // +kubebuilder:default=true + Admission *bool `json:"admission,omitempty" yaml:"admission,omitempty"` + // Background controls if rules are applied to existing resources during a background scan. // Optional. Default value is "true". The value must be set to "false" if the policy rule // uses variables that are only available in the admission review request (e.g. user name). @@ -154,6 +160,15 @@ func (s *Spec) HasVerifyManifests() bool { return false } +// AdmissionProcessingEnabled checks if admission is set to true +func (s *Spec) AdmissionProcessingEnabled() bool { + if s.Admission == nil { + return true + } + + return *s.Admission +} + // BackgroundProcessingEnabled checks if background is set to true func (s *Spec) BackgroundProcessingEnabled() bool { if s.Background == nil { diff --git a/api/kyverno/v2beta1/zz_generated.deepcopy.go b/api/kyverno/v2beta1/zz_generated.deepcopy.go index 8f38766027..3f1962e3a0 100755 --- a/api/kyverno/v2beta1/zz_generated.deepcopy.go +++ b/api/kyverno/v2beta1/zz_generated.deepcopy.go @@ -465,6 +465,11 @@ func (in *Spec) DeepCopyInto(out *Spec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Admission != nil { + in, out := &in.Admission, &out.Admission + *out = new(bool) + **out = **in + } if in.Background != nil { in, out := &in.Background, &out.Background *out = new(bool) diff --git a/charts/kyverno/templates/crds/crds.yaml b/charts/kyverno/templates/crds/crds.yaml index 85d273b1b3..2740442b2c 100644 --- a/charts/kyverno/templates/crds/crds.yaml +++ b/charts/kyverno/templates/crds/crds.yaml @@ -3836,36 +3836,39 @@ spec: scope: Cluster versions: - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -3892,6 +3895,11 @@ spec: spec: description: Spec declares policy behaviors. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -11955,36 +11963,39 @@ spec: subresources: status: {} - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -12011,6 +12022,11 @@ spec: spec: description: Spec declares policy behaviors. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -19814,36 +19830,39 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -19871,6 +19890,11 @@ spec: spec: description: Spec defines policy behaviors and contains one or more rules. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -27935,36 +27959,39 @@ spec: subresources: status: {} - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -27992,6 +28019,11 @@ spec: spec: description: Spec defines policy behaviors and contains one or more rules. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` diff --git a/config/crds/kyverno.io_clusterpolicies.yaml b/config/crds/kyverno.io_clusterpolicies.yaml index bbf47e4edc..4b8d990f15 100644 --- a/config/crds/kyverno.io_clusterpolicies.yaml +++ b/config/crds/kyverno.io_clusterpolicies.yaml @@ -20,36 +20,39 @@ spec: scope: Cluster versions: - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -76,6 +79,11 @@ spec: spec: description: Spec declares policy behaviors. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -8139,36 +8147,39 @@ spec: subresources: status: {} - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -8195,6 +8206,11 @@ spec: spec: description: Spec declares policy behaviors. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` diff --git a/config/crds/kyverno.io_policies.yaml b/config/crds/kyverno.io_policies.yaml index 67ced1084d..de5a1aeb62 100644 --- a/config/crds/kyverno.io_policies.yaml +++ b/config/crds/kyverno.io_policies.yaml @@ -20,36 +20,39 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -77,6 +80,11 @@ spec: spec: description: Spec defines policy behaviors and contains one or more rules. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -8141,36 +8149,39 @@ spec: subresources: status: {} - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -8198,6 +8209,11 @@ spec: spec: description: Spec defines policy behaviors and contains one or more rules. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` diff --git a/config/install-latest-testing.yaml b/config/install-latest-testing.yaml index 75e1f76c15..8edceca52f 100644 --- a/config/install-latest-testing.yaml +++ b/config/install-latest-testing.yaml @@ -4039,36 +4039,39 @@ spec: scope: Cluster versions: - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -4095,6 +4098,11 @@ spec: spec: description: Spec declares policy behaviors. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -12158,36 +12166,39 @@ spec: subresources: status: {} - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -12214,6 +12225,11 @@ spec: spec: description: Spec declares policy behaviors. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -20017,36 +20033,39 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -20074,6 +20093,11 @@ spec: spec: description: Spec defines policy behaviors and contains one or more rules. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` @@ -28138,36 +28162,39 @@ spec: subresources: status: {} - additionalPrinterColumns: + - jsonPath: .spec.admission + name: ADMISSION + type: boolean - jsonPath: .spec.background - name: Background + name: BACKGROUND type: boolean - jsonPath: .spec.validationFailureAction - name: Validate Action - type: string - - jsonPath: .spec.failurePolicy - name: Failure Policy - priority: 1 + name: VALIDATE ACTION type: string - jsonPath: .status.conditions[?(@.type == "Ready")].status - name: Ready + name: READY type: string - jsonPath: .metadata.creationTimestamp - name: Age + name: AGE type: date + - jsonPath: .spec.failurePolicy + name: FAILURE POLICY + priority: 1 + type: string - jsonPath: .status.rulecount.validate - name: Validate + name: VALIDATE priority: 1 type: integer - jsonPath: .status.rulecount.mutate - name: Mutate + name: MUTATE priority: 1 type: integer - jsonPath: .status.rulecount.generate - name: Generate + name: GENERATE priority: 1 type: integer - jsonPath: .status.rulecount.verifyimages - name: Verifyimages + name: VERIFY IMAGES priority: 1 type: integer - jsonPath: .status.conditions[?(@.type == "Ready")].message @@ -28195,6 +28222,11 @@ spec: spec: description: Spec defines policy behaviors and contains one or more rules. properties: + admission: + default: true + description: Admission controls if rules are applied during admission. + Optional. Default value is "true". + type: boolean applyRules: description: ApplyRules controls how rules in a policy are applied. Rule are processed in the order of declaration. When set to `One` diff --git a/docs/user/crd/index.html b/docs/user/crd/index.html index 4fe91c8079..004ca18a4f 100644 --- a/docs/user/crd/index.html +++ b/docs/user/crd/index.html @@ -185,6 +185,19 @@ namespace-wise. It overrides ValidationFailureAction for the specified namespace
admission
Admission controls if rules are applied during admission. +Optional. Default value is “true”.
+background
admission
Admission controls if rules are applied during admission. +Optional. Default value is “true”.
+background
admission
Admission controls if rules are applied during admission. +Optional. Default value is “true”.
+background
admission
Admission controls if rules are applied during admission. +Optional. Default value is “true”.
+background
admission
Admission controls if rules are applied during admission. +Optional. Default value is “true”.
+background
admission
Admission controls if rules are applied during admission. +Optional. Default value is “true”.
+background