From 2a656f6de00173295a6f65ddd71fae9fbfd3d097 Mon Sep 17 00:00:00 2001
From: shuting
Date: Mon, 25 Apr 2022 20:20:40 +0800
Subject: [PATCH] feat: mutate existing resources (#3669)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat: mutate existing, replace GR by UR in webhook server (#3601)
* add attributes for post mutation
Signed-off-by: ShutingZhao
* add UR informer to webhook server
Signed-off-by: ShutingZhao
* - replace gr with ur in the webhook server; - create ur for mutateExsiting policies
Signed-off-by: ShutingZhao
* replace gr by ur across entire packages
Signed-off-by: ShutingZhao
* add YAMLs
Signed-off-by: ShutingZhao
* update api docs & fix unit tests
Signed-off-by: ShutingZhao
* add UR deletion handler
Signed-off-by: ShutingZhao
* add api docs for v1beta1
Signed-off-by: ShutingZhao
* fix clientset method
Signed-off-by: ShutingZhao
* fix v1beta1 client registration
Signed-off-by: ShutingZhao
* feat: mutate existing - generates UR for admission requests (#3623)
Signed-off-by: ShutingZhao
* replace with UR in policy controller generate rules (#3635)
Signed-off-by: prateekpandey14
* - enable mutate engine to process mutateExisting rules; - add unit tests
Signed-off-by: ShutingZhao
* implemented ur background reconciliation for mutateExisting policies
Signed-off-by: ShutingZhao
* fix webhook update error
Signed-off-by: ShutingZhao
* temporary comment out new unit tests
Signed-off-by: ShutingZhao
* feat: mutate existing, replace GR by UR in webhook server (#3601)
* add attributes for post mutation
Signed-off-by: ShutingZhao
* add UR informer to webhook server
Signed-off-by: ShutingZhao
* - replace gr with ur in the webhook server; - create ur for mutateExsiting policies
Signed-off-by: ShutingZhao
* replace gr by ur across entire packages
Signed-off-by: ShutingZhao
* fix missing policy.kyverno.io/policy-name label (#3599)
Signed-off-by: prateekpandey14
* refactor cli code from pkg to cmd (#3591)
* refactor cli code from pkg to cmd
Signed-off-by: Mritunjay Sharma
* fixes in imports
Signed-off-by: Mritunjay Sharma
* fixes tests
Signed-off-by: Mritunjay Sharma
* fixed conflicts
Signed-off-by: Mritunjay Sharma
* moved non-commands to utils
Signed-off-by: Mritunjay Sharma
Co-authored-by: Vyankatesh Kudtarkar
* add YAMLs
Signed-off-by: ShutingZhao
* update api docs & fix unit tests
Signed-off-by: ShutingZhao
* add UR deletion handler
Signed-off-by: ShutingZhao
* add api docs for v1beta1
Signed-off-by: ShutingZhao
* fix clientset method
Signed-off-by: ShutingZhao
* add-kms-libraries for cosign (#3603)
* add-kms-libraries
Signed-off-by: anushkamittal20
* Shifted providers to cosign package
Signed-off-by: anushkamittal20
Signed-off-by: ShutingZhao
* Add support for custom image extractors (#3596)
Signed-off-by: Sambhav Kothari
* Update vulnerable dependencies (#3577)
Signed-off-by: Shubham Gupta
Co-authored-by: Jim Bugwadia
Signed-off-by: ShutingZhao
* fix v1beta1 client registration
Signed-off-by: ShutingZhao
* feat: mutate existing - generates UR for admission requests (#3623)
Signed-off-by: ShutingZhao
* updating version in Chart.yaml (#3618)
* updatimg version in Chart.yaml
Signed-off-by: Prateeknandle
* changes from, make gen-helm
Signed-off-by: Prateeknandle
Co-authored-by: Vyankatesh Kudtarkar
Signed-off-by: ShutingZhao
* Allow kyverno-policies to have preconditions defined (#3606)
* Allow kyverno-policies to have preconditions defined
Signed-off-by: Trey Dockendorf
* Fix docs
Signed-off-by: Trey Dockendorf
Signed-off-by: ShutingZhao
* replace with UR in policy controller generate rules (#3635)
Signed-off-by: prateekpandey14
Signed-off-by: ShutingZhao
* - enable mutate engine to process mutateExisting rules; - add unit tests
Signed-off-by: ShutingZhao
* implemented ur background reconciliation for mutateExisting policies
Signed-off-by: ShutingZhao
* fix webhook update error
Signed-off-by: ShutingZhao
* temporary comment out new unit tests
Signed-off-by: ShutingZhao
* Image verify attestors (#3614)
* fix logs
Signed-off-by: Jim Bugwadia
* fix logs
Signed-off-by: Jim Bugwadia
* support multiple attestors
Signed-off-by: Jim Bugwadia
* rm CLI tests (not currently supported)
Signed-off-by: Jim Bugwadia
* apply attestor repo
Signed-off-by: Jim Bugwadia
* fix linter issues
Signed-off-by: Jim Bugwadia
* fix entryError assignment
Signed-off-by: Jim Bugwadia
* fix tests
Signed-off-by: Jim Bugwadia
* format
Signed-off-by: Jim Bugwadia
* add intermediary certs
Signed-off-by: Jim Bugwadia
* Allow defining imagePullSecrets (#3633)
* Allow defining imagePullSecrets
Signed-off-by: Trey Dockendorf
* Use dict for imagePullSecrets
Signed-off-by: Trey Dockendorf
* Simplify how imagePullSecrets is defined
Signed-off-by: Trey Dockendorf
Signed-off-by: ShutingZhao
* Fix race condition in pCache (#3632)
* fix race condition in pCache
Signed-off-by: ShutingZhao
* refact: remove unused Run function from generate (#3638)
Signed-off-by: prateekpandey14
* Remove helm mode setting (#3628)
Signed-off-by: Charles-Edouard Brétéché
Signed-off-by: ShutingZhao
* refactor: image utils (#3630)
Signed-off-by: Charles-Edouard Brétéché
Signed-off-by: ShutingZhao
* -resolve lift comments; -fix informer sync issue
Signed-off-by: ShutingZhao
* refact the update request cleanup controller
Signed-off-by: prateekpandey14
* - fix delete request for mutateExisting; - fix context variable substitution; - improve logging
Signed-off-by: ShutingZhao
* - enable events; - add last applied annotation
Signed-off-by: ShutingZhao
* enable mutate existing on policy creation
Signed-off-by: ShutingZhao
* update autogen code
Signed-off-by: ShutingZhao
* merge main
Signed-off-by: ShutingZhao
* add unit tests
Signed-off-by: ShutingZhao
* address list comments
Signed-off-by: ShutingZhao
* update api docs
Signed-off-by: ShutingZhao
* fix "Implicit memory aliasing in for loop"
Signed-off-by: ShutingZhao
* remove unused definitions
Signed-off-by: ShutingZhao
* update api docs
Signed-off-by: ShutingZhao
Co-authored-by: Prateek Pandey
Co-authored-by: Mritunjay Kumar Sharma
Co-authored-by: Vyankatesh Kudtarkar
Co-authored-by: Anushka Mittal <55237170+anushkamittal20@users.noreply.github.com>
Co-authored-by: Sambhav Kothari
Co-authored-by: Shubham Gupta
Co-authored-by: Jim Bugwadia
Co-authored-by: Prateek Nandle <56027872+Prateeknandle@users.noreply.github.com>
Co-authored-by: treydock
Co-authored-by: Charles-Edouard Brétéché
---
Makefile | 1 +
api/kyverno/v1/common_types.go | 18 +
api/kyverno/v1/resource_description_types.go | 2 +-
api/kyverno/v1/rule_types.go | 5 +
api/kyverno/v1/spec_types.go | 2 +-
api/kyverno/v1/zz_generated.deepcopy.go | 21 +
api/kyverno/v1beta1/doc.go | 21 +
api/kyverno/v1beta1/updaterequest_types.go | 17 +-
charts/kyverno/templates/crds.yaml | 378 ++++++++--
.../kubectl-kyverno/apply/apply_command.go | 4 +-
cmd/cli/kubectl-kyverno/test/test_command.go | 3 +-
.../kubectl-kyverno/utils/common/common.go | 14 +-
.../utils/common/common_test.go | 4 +-
cmd/kyverno/main.go | 27 +-
config/crds/kustomization.yaml | 1 +
config/crds/kyverno.io_clusterpolicies.yaml | 222 +++---
config/crds/kyverno.io_policies.yaml | 222 +++---
config/crds/kyverno.io_updaterequests.yaml | 8 +-
config/install.yaml | 650 +++++++++++++-----
config/install_debug.yaml | 644 ++++++++++++-----
config/k8s-resource/clusterroles.yaml | 2 +
docs/crd/v1/index.html | 101 ++-
docs/crd/v1beta1/index.html | 436 ++++++++++++
go.mod | 1 +
pkg/background/common/context.go | 118 ++++
pkg/background/common/report.go | 34 +
pkg/background/common/resource.go | 55 ++
pkg/background/common/status.go | 69 +-
pkg/background/common/util.go | 6 +-
pkg/background/generate/cleanup/cleanup.go | 8 +-
pkg/background/generate/cleanup/controller.go | 62 +-
pkg/background/generate/cleanup/resource.go | 2 +-
pkg/background/generate/generate.go | 81 +--
pkg/background/generate/report.go | 21 -
pkg/background/generate/resource.go | 42 --
pkg/background/mutate/mutate.go | 243 +++++++
pkg/background/request_process.go | 22 +-
pkg/background/update_request_controller.go | 111 ++-
pkg/client/clientset/versioned/clientset.go | 4 +-
.../versioned/fake/clientset_generated.go | 2 +-
.../clientset/versioned/fake/register.go | 2 +
.../typed/kyverno/v1beta1/kyverno_client.go | 4 +-
.../informers/externalversions/generic.go | 4 +
.../externalversions/kyverno/interface.go | 8 +
pkg/common/common.go | 6 +-
pkg/engine/background.go | 143 ++++
pkg/engine/context/context.go | 6 +-
pkg/engine/context/context_test.go | 4 +-
pkg/engine/generation.go | 133 +---
pkg/engine/imageVerify.go | 18 +-
pkg/engine/loadtargets.go | 61 ++
pkg/engine/mutate/mutation_test.go | 2 +-
pkg/engine/mutation.go | 68 +-
pkg/engine/mutation_test.go | 257 ++++++-
pkg/engine/policyContext.go | 8 +-
pkg/engine/response/response.go | 3 +
pkg/engine/utils.go | 28 +-
pkg/engine/utils_test.go | 60 +-
pkg/engine/validation.go | 34 +-
pkg/engine/validation_test.go | 6 +-
pkg/engine/variables/variables_test.go | 11 +-
pkg/engine/variables/vars.go | 4 +-
pkg/event/controller.go | 28 +-
pkg/event/source.go | 3 +
pkg/openapi/validation.go | 2 +-
pkg/policy/background.go | 6 +
pkg/policy/policy_controller.go | 167 ++++-
pkg/policycache/policy_cache.go | 2 +-
pkg/testrunner/scenario.go | 2 +-
pkg/utils/annotations.go | 142 ++++
pkg/{webhooks => utils}/annotations_test.go | 16 +-
pkg/webhookconfig/certmanager.go | 3 +-
pkg/webhookconfig/configmanager.go | 20 +-
pkg/webhooks/common.go | 3 +-
pkg/webhooks/generation.go | 78 +--
pkg/webhooks/handlers.go | 50 +-
pkg/webhooks/handlers/admission.go | 13 +-
pkg/webhooks/mutation.go | 2 +-
pkg/webhooks/server.go | 26 +-
pkg/webhooks/updaterequest.go | 71 ++
pkg/webhooks/updaterequest/generator.go | 224 ++++++
pkg/webhooks/validate_audit.go | 18 +-
82 files changed, 4239 insertions(+), 1191 deletions(-)
create mode 100644 api/kyverno/v1beta1/doc.go
create mode 100644 docs/crd/v1beta1/index.html
create mode 100644 pkg/background/common/context.go
create mode 100644 pkg/background/common/report.go
create mode 100644 pkg/background/common/resource.go
delete mode 100644 pkg/background/generate/report.go
delete mode 100644 pkg/background/generate/resource.go
create mode 100644 pkg/background/mutate/mutate.go
create mode 100644 pkg/engine/background.go
create mode 100644 pkg/engine/loadtargets.go
create mode 100644 pkg/utils/annotations.go
rename pkg/{webhooks => utils}/annotations_test.go (91%)
create mode 100644 pkg/webhooks/updaterequest.go
create mode 100644 pkg/webhooks/updaterequest/generator.go
diff --git a/Makefile b/Makefile
index 18e3f37135..b35c7da238 100644
--- a/Makefile
+++ b/Makefile
@@ -156,6 +156,7 @@ generate-api-docs: gen-crd-api-reference-docs ## Generate api reference docs
rm -rf docs/crd
mkdir docs/crd
gen-crd-api-reference-docs -v 6 -api-dir ./api/kyverno/v1alpha2 -config docs/config.json -template-dir docs/template -out-file docs/crd/v1alpha2/index.html
+ gen-crd-api-reference-docs -v 6 -api-dir ./api/kyverno/v1beta1 -config docs/config.json -template-dir docs/template -out-file docs/crd/v1beta1/index.html
gen-crd-api-reference-docs -v 6 -api-dir ./api/kyverno/v1 -config docs/config.json -template-dir docs/template -out-file docs/crd/v1/index.html
.PHONY: verify-api-docs
diff --git a/api/kyverno/v1/common_types.go b/api/kyverno/v1/common_types.go
index 5e31ec1130..db6a99eef5 100755
--- a/api/kyverno/v1/common_types.go
+++ b/api/kyverno/v1/common_types.go
@@ -215,6 +215,18 @@ type ResourceFilter struct {
// Mutation defines how resource are modified.
type Mutation struct {
+
+ // mutateExisting controls whether to mutate existing resource ONLY
+ // The existing resources will be mutated ONLY if set to "true".
+ // Otherwise all resources including admission requests are mutated.
+ // Optional. Defaults to "false" if not specified.
+ // +optional
+ MutateExisting bool `json:"mutateExisting,omitempty" yaml:"mutatingExisting,omitempty"`
+
+ // Targets defines the target resources to be mutated.
+ // +optional
+ Targets []TargetMutation `json:"targets,omitempty" yaml:"targets,omitempty"`
+
// PatchStrategicMerge is a strategic merge patch used to modify resources.
// See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
// and https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/.
@@ -231,6 +243,12 @@ type Mutation struct {
ForEachMutation []*ForEachMutation `json:"foreach,omitempty" yaml:"foreach,omitempty"`
}
+type TargetMutation struct {
+ // ResourceSpec specifies the target resource information.
+ // +optional
+ ResourceSpec `json:",omitempty" yaml:",omitempty"`
+}
+
func (m *Mutation) GetPatchStrategicMerge() apiextensions.JSON {
return FromJSON(m.RawPatchStrategicMerge)
}
diff --git a/api/kyverno/v1/resource_description_types.go b/api/kyverno/v1/resource_description_types.go
index 17fac7b3c3..d12533b4ca 100644
--- a/api/kyverno/v1/resource_description_types.go
+++ b/api/kyverno/v1/resource_description_types.go
@@ -17,12 +17,12 @@ type ResourceDescription struct {
// Name is the name of the resource. The name supports wildcard characters
// "*" (matches zero or many characters) and "?" (at least one character).
+ // NOTE: "Name" is being deprecated in favor of "Names".
// +optional
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// Names are the names of the resources. Each name supports wildcard characters
// "*" (matches zero or many characters) and "?" (at least one character).
- // NOTE: "Name" is being deprecated in favor of "Names".
// +optional
Names []string `json:"names,omitempty" yaml:"names,omitempty"`
diff --git a/api/kyverno/v1/rule_types.go b/api/kyverno/v1/rule_types.go
index c201d437d8..936d501ccb 100644
--- a/api/kyverno/v1/rule_types.go
+++ b/api/kyverno/v1/rule_types.go
@@ -87,6 +87,11 @@ func (r *Rule) HasGenerate() bool {
return !reflect.DeepEqual(r.Generation, Generation{})
}
+// IsMutatingExisting checks if the mutate rule applies to existing resources
+func (r *Rule) IsMutateExisting() bool {
+ return r.Mutation.Targets != nil
+}
+
func (r *Rule) GetAnyAllConditions() apiextensions.JSON {
return FromJSON(r.RawAnyAllConditions)
}
diff --git a/api/kyverno/v1/spec_types.go b/api/kyverno/v1/spec_types.go
index b35de068c9..594f6a2e9f 100644
--- a/api/kyverno/v1/spec_types.go
+++ b/api/kyverno/v1/spec_types.go
@@ -14,7 +14,7 @@ type ValidationFailureAction string
const (
// Enforce blocks the request on failure
Enforce ValidationFailureAction = "enforce"
- // Audit indicates not to block the request on failure, but report failiures as policy violations
+ // Audit indicates not to block the request on failure, but report failures as policy violations
Audit ValidationFailureAction = "audit"
)
diff --git a/api/kyverno/v1/zz_generated.deepcopy.go b/api/kyverno/v1/zz_generated.deepcopy.go
index abc739f855..7e33bd5408 100755
--- a/api/kyverno/v1/zz_generated.deepcopy.go
+++ b/api/kyverno/v1/zz_generated.deepcopy.go
@@ -745,6 +745,11 @@ func (in *MatchResources) DeepCopy() *MatchResources {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Mutation) DeepCopyInto(out *Mutation) {
*out = *in
+ if in.Targets != nil {
+ in, out := &in.Targets, &out.Targets
+ *out = make([]TargetMutation, len(*in))
+ copy(*out, *in)
+ }
if in.RawPatchStrategicMerge != nil {
in, out := &in.RawPatchStrategicMerge, &out.RawPatchStrategicMerge
*out = new(apiextensionsv1.JSON)
@@ -1110,6 +1115,22 @@ func (in *StaticKeyAttestor) DeepCopy() *StaticKeyAttestor {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TargetMutation) DeepCopyInto(out *TargetMutation) {
+ *out = *in
+ out.ResourceSpec = in.ResourceSpec
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetMutation.
+func (in *TargetMutation) DeepCopy() *TargetMutation {
+ if in == nil {
+ return nil
+ }
+ out := new(TargetMutation)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *UserInfo) DeepCopyInto(out *UserInfo) {
*out = *in
diff --git a/api/kyverno/v1beta1/doc.go b/api/kyverno/v1beta1/doc.go
new file mode 100644
index 0000000000..c57fb8c11e
--- /dev/null
+++ b/api/kyverno/v1beta1/doc.go
@@ -0,0 +1,21 @@
+/*
+Copyright 2020 The Kubernetes authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package v1beta1 contains API Schema definitions for the policy v1alpha1 API group
+// +k8s:deepcopy-gen=package
+// +kubebuilder:object:generate=true
+// +groupName=kyverno.io
+package v1beta1
diff --git a/api/kyverno/v1beta1/updaterequest_types.go b/api/kyverno/v1beta1/updaterequest_types.go
index a8c262e8d9..35b01b0767 100644
--- a/api/kyverno/v1beta1/updaterequest_types.go
+++ b/api/kyverno/v1beta1/updaterequest_types.go
@@ -52,7 +52,7 @@ type UpdateRequestStatus struct {
// +kubebuilder:printcolumn:name="ResourceNamespace",type="string",JSONPath=".spec.resource.namespace"
// +kubebuilder:printcolumn:name="status",type="string",JSONPath=".status.state"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
-// +kubebuilder:resource:shortName=gr
+// +kubebuilder:resource:shortName=ur
type UpdateRequest struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -65,8 +65,19 @@ type UpdateRequest struct {
Status UpdateRequestStatus `json:"status,omitempty"`
}
+type RequestType string
+
+const (
+ Mutate RequestType = "mutate"
+ Generate RequestType = "generate"
+)
+
// UpdateRequestSpec stores the request specification.
type UpdateRequestSpec struct {
+ // Type represents request type for background processing
+ // +kubebuilder:validation:Enum=mutate;generate
+ Type RequestType `json:"requestType,omitempty" yaml:"requestType,omitempty"`
+
// Specifies the name of the policy.
Policy string `json:"policy" yaml:"policy"`
@@ -139,3 +150,7 @@ type UpdateRequestList struct {
func init() {
SchemeBuilder.Register(&UpdateRequest{}, &UpdateRequestList{})
}
+
+func (s *UpdateRequestSpec) GetRequestType() RequestType {
+ return s.Type
+}
diff --git a/charts/kyverno/templates/crds.yaml b/charts/kyverno/templates/crds.yaml
index af40189b88..4fe60e11a0 100644
--- a/charts/kyverno/templates/crds.yaml
+++ b/charts/kyverno/templates/crds.yaml
@@ -5,7 +5,6 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
config.kubernetes.io/index: '1'
- internal.config.kubernetes.io/index: '1'
creationTimestamp: null
labels:
app.kubernetes.io/component: kyverno
@@ -155,10 +154,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -281,10 +280,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -402,10 +401,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -585,10 +584,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -711,10 +710,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -832,10 +831,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -1082,12 +1081,34 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing resource ONLY The existing resources will be mutated ONLY if set to "true". Otherwise all resources including admission requests are mutated. Optional. Defaults to "false" if not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/ and https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/.
x-kubernetes-preserve-unknown-fields: true
patchesJson6902:
description: PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902 and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be unique within the policy.
@@ -1661,10 +1682,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -1787,10 +1808,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -1908,10 +1929,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -2091,10 +2112,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -2217,10 +2238,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -2338,10 +2359,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -2588,12 +2609,34 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing resource ONLY The existing resources will be mutated ONLY if set to "true". Otherwise all resources including admission requests are mutated. Optional. Defaults to "false" if not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/ and https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/.
x-kubernetes-preserve-unknown-fields: true
patchesJson6902:
description: PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902 and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be unique within the policy.
@@ -3000,7 +3043,6 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
config.kubernetes.io/index: '2'
- internal.config.kubernetes.io/index: '2'
creationTimestamp: null
labels:
app.kubernetes.io/component: kyverno
@@ -3272,7 +3314,6 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
config.kubernetes.io/index: '3'
- internal.config.kubernetes.io/index: '3'
creationTimestamp: null
labels:
app.kubernetes.io/component: kyverno
@@ -3544,7 +3585,6 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
config.kubernetes.io/index: '4'
- internal.config.kubernetes.io/index: '4'
creationTimestamp: null
labels:
app.kubernetes.io/component: kyverno
@@ -3728,7 +3768,6 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
config.kubernetes.io/index: '5'
- internal.config.kubernetes.io/index: '5'
creationTimestamp: null
labels:
app.kubernetes.io/component: kyverno
@@ -3878,10 +3917,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4004,10 +4043,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4125,10 +4164,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4308,10 +4347,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4434,10 +4473,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4555,10 +4594,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4805,12 +4844,34 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing resource ONLY The existing resources will be mutated ONLY if set to "true". Otherwise all resources including admission requests are mutated. Optional. Defaults to "false" if not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/ and https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/.
x-kubernetes-preserve-unknown-fields: true
patchesJson6902:
description: PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902 and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be unique within the policy.
@@ -5384,10 +5445,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -5510,10 +5571,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -5631,10 +5692,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -5814,10 +5875,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -5940,10 +6001,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -6061,10 +6122,10 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character). NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each name supports wildcard characters "*" (matches zero or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -6311,12 +6372,34 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing resource ONLY The existing resources will be mutated ONLY if set to "true". Otherwise all resources including admission requests are mutated. Optional. Defaults to "false" if not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/ and https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/.
x-kubernetes-preserve-unknown-fields: true
patchesJson6902:
description: PatchesJSON6902 is a list of RFC 6902 JSON Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902 and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be unique within the policy.
@@ -6723,7 +6806,6 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
config.kubernetes.io/index: '6'
- internal.config.kubernetes.io/index: '6'
creationTimestamp: null
labels:
app.kubernetes.io/component: kyverno
@@ -6995,7 +7077,6 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
config.kubernetes.io/index: '7'
- internal.config.kubernetes.io/index: '7'
creationTimestamp: null
labels:
app.kubernetes.io/component: kyverno
@@ -7260,4 +7341,191 @@ status:
plural: ""
conditions: []
storedVersions: []
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.8.0
+ config.kubernetes.io/index: '8'
+ creationTimestamp: null
+ labels:
+ app.kubernetes.io/component: kyverno
+ app.kubernetes.io/instance: kyverno
+ app.kubernetes.io/name: kyverno
+ app.kubernetes.io/part-of: kyverno
+ app.kubernetes.io/version: latest
+ name: updaterequests.kyverno.io
+spec:
+ group: kyverno.io
+ names:
+ kind: UpdateRequest
+ listKind: UpdateRequestList
+ plural: updaterequests
+ shortNames:
+ - ur
+ singular: updaterequest
+ scope: Namespaced
+ versions:
+ - additionalPrinterColumns:
+ - jsonPath: .spec.policy
+ name: Policy
+ type: string
+ - jsonPath: .spec.resource.kind
+ name: ResourceKind
+ type: string
+ - jsonPath: .spec.resource.name
+ name: ResourceName
+ type: string
+ - jsonPath: .spec.resource.namespace
+ name: ResourceNamespace
+ type: string
+ - jsonPath: .status.state
+ name: status
+ type: string
+ - jsonPath: .metadata.creationTimestamp
+ name: Age
+ type: date
+ name: v1beta1
+ schema:
+ openAPIV3Schema:
+ description: UpdateRequestStatus is a request to process mutate and generate rules in background.
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the information to identify the update request.
+ properties:
+ context:
+ description: Context ...
+ properties:
+ admissionRequestInfo:
+ description: AdmissionRequestInfoObject stores the admission request and operation details
+ properties:
+ admissionRequest:
+ type: string
+ operation:
+ description: Operation is the type of resource operation being checked for admission control
+ type: string
+ type: object
+ userInfo:
+ description: RequestInfo contains permission info carried in an admission request.
+ properties:
+ clusterRoles:
+ description: ClusterRoles is a list of possible clusterRoles send the request.
+ items:
+ type: string
+ nullable: true
+ type: array
+ roles:
+ description: Roles is a list of possible role send the request.
+ items:
+ type: string
+ nullable: true
+ type: array
+ userInfo:
+ description: UserInfo is the userInfo carried in the admission request.
+ properties:
+ extra:
+ additionalProperties:
+ description: ExtraValue masks the value so protobuf can generate
+ items:
+ type: string
+ type: array
+ description: Any additional information provided by the authenticator.
+ type: object
+ groups:
+ description: The names of groups this user is a part of.
+ items:
+ type: string
+ type: array
+ uid:
+ description: A unique value that identifies this user across time. If this user is deleted and another user by the same name is added, they will have different UIDs.
+ type: string
+ username:
+ description: The name that uniquely identifies this user among all active users.
+ type: string
+ type: object
+ type: object
+ type: object
+ policy:
+ description: Specifies the name of the policy.
+ type: string
+ requestType:
+ description: Type represents request type for background processing
+ enum:
+ - mutate
+ - generate
+ type: string
+ resource:
+ description: ResourceSpec is the information to identify the update request.
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ required:
+ - context
+ - policy
+ - resource
+ type: object
+ status:
+ description: Status contains statistics related to update request.
+ properties:
+ generatedResources:
+ description: This will track the resources that are updated by the generate Policy. Will be used during clean up resources.
+ items:
+ description: ResourceSpec contains information to identify a resource.
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
+ message:
+ description: Specifies request status message.
+ type: string
+ state:
+ description: State represents state of the generate request.
+ type: string
+ required:
+ - state
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
+status:
+ acceptedNames:
+ kind: ""
+ plural: ""
+ conditions: []
+ storedVersions: []
{{- end }}
diff --git a/cmd/cli/kubectl-kyverno/apply/apply_command.go b/cmd/cli/kubectl-kyverno/apply/apply_command.go
index e6898f1b86..944013050a 100644
--- a/cmd/cli/kubectl-kyverno/apply/apply_command.go
+++ b/cmd/cli/kubectl-kyverno/apply/apply_command.go
@@ -8,7 +8,7 @@ import (
"time"
"github.com/go-git/go-billy/v5/memfs"
- v1 "github.com/kyverno/kyverno/api/kyverno/v1"
+ "github.com/kyverno/kyverno/api/kyverno/v1beta1"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/common"
sanitizederror "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/sanitizedError"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/store"
@@ -246,7 +246,7 @@ func applyCommandHelper(resourcePaths []string, userInfoPath string, cluster boo
}
// get the user info as request info from a different file
- var userInfo v1.RequestInfo
+ var userInfo v1beta1.RequestInfo
if userInfoPath != "" {
userInfo, err = common.GetUserInfoFromPath(fs, userInfoPath, false, "")
if err != nil {
diff --git a/cmd/cli/kubectl-kyverno/test/test_command.go b/cmd/cli/kubectl-kyverno/test/test_command.go
index 6e18a78204..ae20537dc2 100644
--- a/cmd/cli/kubectl-kyverno/test/test_command.go
+++ b/cmd/cli/kubectl-kyverno/test/test_command.go
@@ -17,6 +17,7 @@ import (
"github.com/go-git/go-billy/v5/memfs"
"github.com/kataras/tablewriter"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
+ "github.com/kyverno/kyverno/api/kyverno/v1beta1"
report "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/common"
sanitizederror "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/sanitizedError"
@@ -750,7 +751,7 @@ func applyPoliciesFromPath(fs billy.Filesystem, policyBytes []byte, isGit bool,
}
// get the user info as request info from a different file
- var userInfo v1.RequestInfo
+ var userInfo v1beta1.RequestInfo
if userInfoFile != "" {
userInfo, err = common.GetUserInfoFromPath(fs, userInfoFile, isGit, policyResourcePath)
if err != nil {
diff --git a/cmd/cli/kubectl-kyverno/utils/common/common.go b/cmd/cli/kubectl-kyverno/utils/common/common.go
index 70a67b2c24..14b5f4302a 100644
--- a/cmd/cli/kubectl-kyverno/utils/common/common.go
+++ b/cmd/cli/kubectl-kyverno/utils/common/common.go
@@ -13,21 +13,21 @@ import (
"reflect"
"strings"
- "github.com/kyverno/kyverno/pkg/autogen"
- "github.com/kyverno/kyverno/pkg/engine/variables"
-
jsonpatch "github.com/evanphx/json-patch/v5"
"github.com/go-git/go-billy/v5"
"github.com/go-logr/logr"
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
+ v1beta1 "github.com/kyverno/kyverno/api/kyverno/v1beta1"
report "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
sanitizederror "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/sanitizedError"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/store"
+ "github.com/kyverno/kyverno/pkg/autogen"
client "github.com/kyverno/kyverno/pkg/dclient"
"github.com/kyverno/kyverno/pkg/engine"
"github.com/kyverno/kyverno/pkg/engine/context"
"github.com/kyverno/kyverno/pkg/engine/response"
ut "github.com/kyverno/kyverno/pkg/engine/utils"
+ "github.com/kyverno/kyverno/pkg/engine/variables"
"github.com/kyverno/kyverno/pkg/policymutation"
"github.com/kyverno/kyverno/pkg/policyreport"
"github.com/kyverno/kyverno/pkg/utils"
@@ -442,7 +442,7 @@ func MutatePolicies(policies []v1.PolicyInterface) ([]v1.PolicyInterface, error)
// ApplyPolicyOnResource - function to apply policy on resource
func ApplyPolicyOnResource(policy v1.PolicyInterface, resource *unstructured.Unstructured,
- mutateLogPath string, mutateLogPathIsDir bool, variables map[string]string, userInfo v1.RequestInfo, policyReport bool,
+ mutateLogPath string, mutateLogPathIsDir bool, variables map[string]string, userInfo v1beta1.RequestInfo, policyReport bool,
namespaceSelectorMap map[string]map[string]string, stdin bool, rc *ResultCounts,
printPatchResource bool) ([]*response.EngineResponse, policyreport.Info, error) {
@@ -595,7 +595,7 @@ OuterLoop:
JSONContext: context.NewContext(),
NamespaceLabels: namespaceLabels,
}
- generateResponse := engine.Generate(policyContext)
+ generateResponse := engine.ApplyBackgroundChecks(policyContext)
if generateResponse != nil {
engineResponses = append(engineResponses, generateResponse)
}
@@ -1051,8 +1051,8 @@ func GetPatchedResourceFromPath(fs billy.Filesystem, path string, isGit bool, po
}
//GetUserInfoFromPath - get the request info as user info from a given path
-func GetUserInfoFromPath(fs billy.Filesystem, path string, isGit bool, policyResourcePath string) (v1.RequestInfo, error) {
- userInfo := &v1.RequestInfo{}
+func GetUserInfoFromPath(fs billy.Filesystem, path string, isGit bool, policyResourcePath string) (v1beta1.RequestInfo, error) {
+ userInfo := &v1beta1.RequestInfo{}
if isGit {
filep, err := fs.Open(filepath.Join(policyResourcePath, path))
diff --git a/cmd/cli/kubectl-kyverno/utils/common/common_test.go b/cmd/cli/kubectl-kyverno/utils/common/common_test.go
index b8af56adc2..7cb26fe48c 100644
--- a/cmd/cli/kubectl-kyverno/utils/common/common_test.go
+++ b/cmd/cli/kubectl-kyverno/utils/common/common_test.go
@@ -3,7 +3,7 @@ package common
import (
"testing"
- v1 "github.com/kyverno/kyverno/api/kyverno/v1"
+ v1beta1 "github.com/kyverno/kyverno/api/kyverno/v1beta1"
"github.com/kyverno/kyverno/pkg/toggle"
ut "github.com/kyverno/kyverno/pkg/utils"
"gotest.tools/assert"
@@ -100,7 +100,7 @@ func Test_NamespaceSelector(t *testing.T) {
for _, tc := range testcases {
policyArray, _ := ut.GetPolicy(tc.policy)
resourceArray, _ := GetResource(tc.resource)
- ApplyPolicyOnResource(policyArray[0], resourceArray[0], "", false, nil, v1.RequestInfo{}, false, tc.namespaceSelectorMap, false, rc, false)
+ ApplyPolicyOnResource(policyArray[0], resourceArray[0], "", false, nil, v1beta1.RequestInfo{}, false, tc.namespaceSelectorMap, false, rc, false)
assert.Equal(t, int64(rc.Pass), int64(tc.result.Pass))
assert.Equal(t, int64(rc.Fail), int64(tc.result.Fail))
// TODO: autogen rules seem to not be present when autogen internals is disabled
diff --git a/cmd/kyverno/main.go b/cmd/kyverno/main.go
index 77d3d5a25c..c1c0828870 100755
--- a/cmd/kyverno/main.go
+++ b/cmd/kyverno/main.go
@@ -43,7 +43,7 @@ import (
"github.com/kyverno/kyverno/pkg/version"
"github.com/kyverno/kyverno/pkg/webhookconfig"
"github.com/kyverno/kyverno/pkg/webhooks"
- webhookgenerate "github.com/kyverno/kyverno/pkg/webhooks/generate"
+ webhookgenerate "github.com/kyverno/kyverno/pkg/webhooks/updaterequest"
)
const resyncPeriod = 15 * time.Minute
@@ -137,10 +137,6 @@ func main() {
}
// KYVERNO CRD CLIENT
- // access CRD resources
- // - ClusterPolicy, Policy
- // - ClusterPolicyReport, PolicyReport
- // - GenerateRequest
pclient, err := kyvernoclient.NewForConfig(clientConfig)
if err != nil {
setupLog.Error(err, "Failed to create client")
@@ -192,12 +188,7 @@ func main() {
cosign.ImageSignatureRepository = imageSignatureRepository
}
- // KYVERNO CRD INFORMER
- // watches CRD resources:
- // - ClusterPolicy, Policy
- // - ClusterPolicyReport, PolicyReport
- // - GenerateRequest
- // - ClusterReportChangeRequest, ReportChangeRequest
+ // KYVERNO CRD INFORMERS
pInformer := kyvernoinformer.NewSharedInformerFactoryWithOptions(pclient, policyControllerResyncPeriod)
// EVENT GENERATOR
@@ -312,6 +303,7 @@ func main() {
pInformer.Kyverno().V1().ClusterPolicies(),
pInformer.Kyverno().V1().Policies(),
pInformer.Kyverno().V1().GenerateRequests(),
+ pInformer.Kyverno().V1beta1().UpdateRequests(),
configData,
eventGenerator,
reportReqGen,
@@ -328,7 +320,11 @@ func main() {
}
// GENERATE REQUEST GENERATOR
- grgen := webhookgenerate.NewGenerator(pclient, pInformer.Kyverno().V1().GenerateRequests(), stopCh, log.Log.WithName("GenerateRequestGenerator"))
+ grgen := webhookgenerate.NewGenerator(pclient,
+ pInformer.Kyverno().V1().GenerateRequests(),
+ pInformer.Kyverno().V1beta1().UpdateRequests(),
+ stopCh,
+ log.Log.WithName("UpdateRequestGenerator"))
// GENERATE CONTROLLER
// - applies generate rules on resources based on generate requests created by webhook
@@ -339,9 +335,10 @@ func main() {
pInformer.Kyverno().V1().ClusterPolicies(),
pInformer.Kyverno().V1().Policies(),
pInformer.Kyverno().V1().GenerateRequests(),
+ pInformer.Kyverno().V1beta1().UpdateRequests(),
eventGenerator,
kubeInformer.Core().V1().Namespaces(),
- log.Log.WithName("GenerateController"),
+ log.Log.WithName("BackgroundController"),
configData,
)
if err != nil {
@@ -358,6 +355,7 @@ func main() {
pInformer.Kyverno().V1().ClusterPolicies(),
pInformer.Kyverno().V1().Policies(),
pInformer.Kyverno().V1().GenerateRequests(),
+ pInformer.Kyverno().V1beta1().UpdateRequests(),
kubeInformer.Core().V1().Namespaces(),
log.Log.WithName("GenerateCleanUpController"),
)
@@ -399,7 +397,7 @@ func main() {
os.Exit(1)
}
- registerWrapperRetry := common.RetryFunc(time.Second, webhookRegistrationTimeout, webhookCfg.Register, setupLog)
+ registerWrapperRetry := common.RetryFunc(time.Second, webhookRegistrationTimeout, webhookCfg.Register, "failed to register webhook", setupLog)
registerWebhookConfigurations := func() {
certManager.InitTLSPemPair()
webhookCfg.Start()
@@ -460,6 +458,7 @@ func main() {
client,
tlsPair,
pInformer.Kyverno().V1().GenerateRequests(),
+ pInformer.Kyverno().V1beta1().UpdateRequests(),
pInformer.Kyverno().V1().ClusterPolicies(),
kubeInformer.Rbac().V1().RoleBindings(),
kubeInformer.Rbac().V1().ClusterRoleBindings(),
diff --git a/config/crds/kustomization.yaml b/config/crds/kustomization.yaml
index fd2e13cbdd..fb2162dd12 100755
--- a/config/crds/kustomization.yaml
+++ b/config/crds/kustomization.yaml
@@ -7,5 +7,6 @@ resources:
- ./kyverno.io_generaterequests.yaml
- ./kyverno.io_policies.yaml
- ./kyverno.io_reportchangerequests.yaml
+- ./kyverno.io_updaterequests.yaml
- ./wgpolicyk8s.io_clusterpolicyreports.yaml
- ./wgpolicyk8s.io_policyreports.yaml
\ No newline at end of file
diff --git a/config/crds/kyverno.io_clusterpolicies.yaml b/config/crds/kyverno.io_clusterpolicies.yaml
index a66d449f61..767101998a 100644
--- a/config/crds/kyverno.io_clusterpolicies.yaml
+++ b/config/crds/kyverno.io_clusterpolicies.yaml
@@ -198,17 +198,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -413,17 +413,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -624,15 +624,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -909,17 +909,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1124,17 +1124,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1335,15 +1335,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -1730,6 +1730,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -1740,6 +1747,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -2636,17 +2663,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -2851,17 +2878,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3062,15 +3089,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -3347,17 +3374,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3562,17 +3589,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3773,15 +3800,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4168,6 +4195,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -4178,6 +4212,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
diff --git a/config/crds/kyverno.io_policies.yaml b/config/crds/kyverno.io_policies.yaml
index 979424a889..b62e35186c 100644
--- a/config/crds/kyverno.io_policies.yaml
+++ b/config/crds/kyverno.io_policies.yaml
@@ -199,17 +199,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -414,17 +414,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -625,15 +625,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -910,17 +910,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1125,17 +1125,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1336,15 +1336,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -1731,6 +1731,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -1741,6 +1748,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -2638,17 +2665,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -2853,17 +2880,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3064,15 +3091,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -3349,17 +3376,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3564,17 +3591,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3775,15 +3802,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4170,6 +4197,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -4180,6 +4214,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
diff --git a/config/crds/kyverno.io_updaterequests.yaml b/config/crds/kyverno.io_updaterequests.yaml
index 48758dd6ec..d1c2c67776 100644
--- a/config/crds/kyverno.io_updaterequests.yaml
+++ b/config/crds/kyverno.io_updaterequests.yaml
@@ -13,7 +13,7 @@ spec:
listKind: UpdateRequestList
plural: updaterequests
shortNames:
- - gr
+ - ur
singular: updaterequest
scope: Namespaced
versions:
@@ -123,6 +123,12 @@ spec:
policy:
description: Specifies the name of the policy.
type: string
+ requestType:
+ description: Type represents request type for background processing
+ enum:
+ - mutate
+ - generate
+ type: string
resource:
description: ResourceSpec is the information to identify the update
request.
diff --git a/config/install.yaml b/config/install.yaml
index 5727912e4a..df3d1b8222 100644
--- a/config/install.yaml
+++ b/config/install.yaml
@@ -215,17 +215,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -430,17 +430,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -641,15 +641,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -926,17 +926,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1141,17 +1141,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1352,15 +1352,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -1747,6 +1747,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -1757,6 +1764,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -2653,17 +2680,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -2868,17 +2895,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3079,15 +3106,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -3364,17 +3391,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3579,17 +3606,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3790,15 +3817,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4185,6 +4212,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -4195,6 +4229,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -5981,17 +6035,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -6196,17 +6250,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -6407,15 +6461,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -6692,17 +6746,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -6907,17 +6961,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -7118,15 +7172,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -7513,6 +7567,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -7523,6 +7584,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -8420,17 +8501,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -8635,17 +8716,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -8846,15 +8927,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -9131,17 +9212,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -9346,17 +9427,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -9557,15 +9638,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -9952,6 +10033,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -9962,6 +10050,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -11342,6 +11450,210 @@ status:
conditions: []
storedVersions: []
---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.8.0
+ creationTimestamp: null
+ labels:
+ app.kubernetes.io/component: kyverno
+ app.kubernetes.io/instance: kyverno
+ app.kubernetes.io/name: kyverno
+ app.kubernetes.io/part-of: kyverno
+ app.kubernetes.io/version: latest
+ name: updaterequests.kyverno.io
+spec:
+ group: kyverno.io
+ names:
+ kind: UpdateRequest
+ listKind: UpdateRequestList
+ plural: updaterequests
+ shortNames:
+ - ur
+ singular: updaterequest
+ scope: Namespaced
+ versions:
+ - additionalPrinterColumns:
+ - jsonPath: .spec.policy
+ name: Policy
+ type: string
+ - jsonPath: .spec.resource.kind
+ name: ResourceKind
+ type: string
+ - jsonPath: .spec.resource.name
+ name: ResourceName
+ type: string
+ - jsonPath: .spec.resource.namespace
+ name: ResourceNamespace
+ type: string
+ - jsonPath: .status.state
+ name: status
+ type: string
+ - jsonPath: .metadata.creationTimestamp
+ name: Age
+ type: date
+ name: v1beta1
+ schema:
+ openAPIV3Schema:
+ description: UpdateRequestStatus is a request to process mutate and generate
+ rules in background.
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the information to identify the update request.
+ properties:
+ context:
+ description: Context ...
+ properties:
+ admissionRequestInfo:
+ description: AdmissionRequestInfoObject stores the admission request
+ and operation details
+ properties:
+ admissionRequest:
+ type: string
+ operation:
+ description: Operation is the type of resource operation being
+ checked for admission control
+ type: string
+ type: object
+ userInfo:
+ description: RequestInfo contains permission info carried in an
+ admission request.
+ properties:
+ clusterRoles:
+ description: ClusterRoles is a list of possible clusterRoles
+ send the request.
+ items:
+ type: string
+ nullable: true
+ type: array
+ roles:
+ description: Roles is a list of possible role send the request.
+ items:
+ type: string
+ nullable: true
+ type: array
+ userInfo:
+ description: UserInfo is the userInfo carried in the admission
+ request.
+ properties:
+ extra:
+ additionalProperties:
+ description: ExtraValue masks the value so protobuf
+ can generate
+ items:
+ type: string
+ type: array
+ description: Any additional information provided by the
+ authenticator.
+ type: object
+ groups:
+ description: The names of groups this user is a part of.
+ items:
+ type: string
+ type: array
+ uid:
+ description: A unique value that identifies this user
+ across time. If this user is deleted and another user
+ by the same name is added, they will have different
+ UIDs.
+ type: string
+ username:
+ description: The name that uniquely identifies this user
+ among all active users.
+ type: string
+ type: object
+ type: object
+ type: object
+ policy:
+ description: Specifies the name of the policy.
+ type: string
+ requestType:
+ description: Type represents request type for background processing
+ enum:
+ - mutate
+ - generate
+ type: string
+ resource:
+ description: ResourceSpec is the information to identify the update
+ request.
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ required:
+ - context
+ - policy
+ - resource
+ type: object
+ status:
+ description: Status contains statistics related to update request.
+ properties:
+ generatedResources:
+ description: This will track the resources that are updated by the
+ generate Policy. Will be used during clean up resources.
+ items:
+ description: ResourceSpec contains information to identify a resource.
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
+ message:
+ description: Specifies request status message.
+ type: string
+ state:
+ description: State represents state of the generate request.
+ type: string
+ required:
+ - state
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
+status:
+ acceptedNames:
+ kind: ""
+ plural: ""
+ conditions: []
+ storedVersions: []
+---
apiVersion: v1
kind: ServiceAccount
metadata:
@@ -11586,6 +11898,8 @@ rules:
- clusterpolicies/status
- generaterequests
- generaterequests/status
+ - updaterequests
+ - updaterequests/status
- reportchangerequests
- reportchangerequests/status
- clusterreportchangerequests
diff --git a/config/install_debug.yaml b/config/install_debug.yaml
index f7bdded60e..4b9f22dada 100755
--- a/config/install_debug.yaml
+++ b/config/install_debug.yaml
@@ -204,17 +204,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -419,17 +419,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -630,15 +630,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -915,17 +915,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1130,17 +1130,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -1341,15 +1341,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -1736,6 +1736,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -1746,6 +1753,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -2642,17 +2669,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -2857,17 +2884,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3068,15 +3095,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -3353,17 +3380,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3568,17 +3595,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -3779,15 +3806,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -4174,6 +4201,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -4184,6 +4218,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -5946,17 +6000,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -6161,17 +6215,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -6372,15 +6426,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -6657,17 +6711,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -6872,17 +6926,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -7083,15 +7137,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -7478,6 +7532,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -7488,6 +7549,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -8385,17 +8466,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -8600,17 +8681,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -8811,15 +8892,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -9096,17 +9177,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -9311,17 +9392,17 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource.
+ description: 'Name is the name of the resource.
The name supports wildcard characters "*" (matches
zero or many characters) and "?" (at least one
- character).
- type: string
- names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one
character). NOTE: "Name" is being deprecated
in favor of "Names".'
+ type: string
+ names:
+ description: Names are the names of the resources.
+ Each name supports wildcard characters "*" (matches
+ zero or many characters) and "?" (at least one
+ character).
items:
type: string
type: array
@@ -9522,15 +9603,15 @@ spec:
type: string
type: array
name:
- description: Name is the name of the resource. The name
- supports wildcard characters "*" (matches zero or
- many characters) and "?" (at least one character).
+ description: 'Name is the name of the resource. The
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
+ NOTE: "Name" is being deprecated in favor of "Names".'
type: string
names:
- description: 'Names are the names of the resources.
- Each name supports wildcard characters "*" (matches
- zero or many characters) and "?" (at least one character).
- NOTE: "Name" is being deprecated in favor of "Names".'
+ description: Names are the names of the resources. Each
+ name supports wildcard characters "*" (matches zero
+ or many characters) and "?" (at least one character).
items:
type: string
type: array
@@ -9917,6 +9998,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
type: array
+ mutateExisting:
+ description: mutateExisting controls whether to mutate existing
+ resource ONLY The existing resources will be mutated ONLY
+ if set to "true". Otherwise all resources including admission
+ requests are mutated. Optional. Defaults to "false" if
+ not specified.
+ type: boolean
patchStrategicMerge:
description: PatchStrategicMerge is a strategic merge patch
used to modify resources. See https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
@@ -9927,6 +10015,26 @@ spec:
Patch declarations used to modify resources. See https://tools.ietf.org/html/rfc6902
and https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/.
type: string
+ targets:
+ description: Targets defines the target resources to be
+ mutated.
+ items:
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
type: object
name:
description: Name is a label to identify the rule, It must be
@@ -11295,6 +11403,204 @@ status:
conditions: []
storedVersions: []
---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.8.0
+ creationTimestamp: null
+ name: updaterequests.kyverno.io
+spec:
+ group: kyverno.io
+ names:
+ kind: UpdateRequest
+ listKind: UpdateRequestList
+ plural: updaterequests
+ shortNames:
+ - ur
+ singular: updaterequest
+ scope: Namespaced
+ versions:
+ - additionalPrinterColumns:
+ - jsonPath: .spec.policy
+ name: Policy
+ type: string
+ - jsonPath: .spec.resource.kind
+ name: ResourceKind
+ type: string
+ - jsonPath: .spec.resource.name
+ name: ResourceName
+ type: string
+ - jsonPath: .spec.resource.namespace
+ name: ResourceNamespace
+ type: string
+ - jsonPath: .status.state
+ name: status
+ type: string
+ - jsonPath: .metadata.creationTimestamp
+ name: Age
+ type: date
+ name: v1beta1
+ schema:
+ openAPIV3Schema:
+ description: UpdateRequestStatus is a request to process mutate and generate
+ rules in background.
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the information to identify the update request.
+ properties:
+ context:
+ description: Context ...
+ properties:
+ admissionRequestInfo:
+ description: AdmissionRequestInfoObject stores the admission request
+ and operation details
+ properties:
+ admissionRequest:
+ type: string
+ operation:
+ description: Operation is the type of resource operation being
+ checked for admission control
+ type: string
+ type: object
+ userInfo:
+ description: RequestInfo contains permission info carried in an
+ admission request.
+ properties:
+ clusterRoles:
+ description: ClusterRoles is a list of possible clusterRoles
+ send the request.
+ items:
+ type: string
+ nullable: true
+ type: array
+ roles:
+ description: Roles is a list of possible role send the request.
+ items:
+ type: string
+ nullable: true
+ type: array
+ userInfo:
+ description: UserInfo is the userInfo carried in the admission
+ request.
+ properties:
+ extra:
+ additionalProperties:
+ description: ExtraValue masks the value so protobuf
+ can generate
+ items:
+ type: string
+ type: array
+ description: Any additional information provided by the
+ authenticator.
+ type: object
+ groups:
+ description: The names of groups this user is a part of.
+ items:
+ type: string
+ type: array
+ uid:
+ description: A unique value that identifies this user
+ across time. If this user is deleted and another user
+ by the same name is added, they will have different
+ UIDs.
+ type: string
+ username:
+ description: The name that uniquely identifies this user
+ among all active users.
+ type: string
+ type: object
+ type: object
+ type: object
+ policy:
+ description: Specifies the name of the policy.
+ type: string
+ requestType:
+ description: Type represents request type for background processing
+ enum:
+ - mutate
+ - generate
+ type: string
+ resource:
+ description: ResourceSpec is the information to identify the update
+ request.
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ required:
+ - context
+ - policy
+ - resource
+ type: object
+ status:
+ description: Status contains statistics related to update request.
+ properties:
+ generatedResources:
+ description: This will track the resources that are updated by the
+ generate Policy. Will be used during clean up resources.
+ items:
+ description: ResourceSpec contains information to identify a resource.
+ properties:
+ apiVersion:
+ description: APIVersion specifies resource apiVersion.
+ type: string
+ kind:
+ description: Kind specifies resource kind.
+ type: string
+ name:
+ description: Name specifies the resource name.
+ maxLength: 63
+ type: string
+ namespace:
+ description: Namespace specifies resource namespace.
+ type: string
+ type: object
+ type: array
+ message:
+ description: Specifies request status message.
+ type: string
+ state:
+ description: State represents state of the generate request.
+ type: string
+ required:
+ - state
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
+status:
+ acceptedNames:
+ kind: ""
+ plural: ""
+ conditions: []
+ storedVersions: []
+---
apiVersion: v1
kind: ServiceAccount
metadata:
@@ -11494,6 +11800,8 @@ rules:
- clusterpolicies/status
- generaterequests
- generaterequests/status
+ - updaterequests
+ - updaterequests/status
- reportchangerequests
- reportchangerequests/status
- clusterreportchangerequests
diff --git a/config/k8s-resource/clusterroles.yaml b/config/k8s-resource/clusterroles.yaml
index b39bdaa40d..034d3be07b 100755
--- a/config/k8s-resource/clusterroles.yaml
+++ b/config/k8s-resource/clusterroles.yaml
@@ -15,6 +15,8 @@ rules:
- clusterpolicies/status
- generaterequests
- generaterequests/status
+ - updaterequests
+ - updaterequests/status
- reportchangerequests
- reportchangerequests/status
- clusterreportchangerequests
diff --git a/docs/crd/v1/index.html b/docs/crd/v1/index.html
index 52e1df85c7..f944213c17 100644
--- a/docs/crd/v1/index.html
+++ b/docs/crd/v1/index.html
@@ -209,8 +209,8 @@ string
@@ -1832,6 +1832,35 @@ Please specify under “any” or “all” instead.
+mutateExisting
+
+bool
+
+
+
+(Optional)
+
mutateExisting controls whether to mutate existing resource ONLY
+The existing resources will be mutated ONLY if set to “true”.
+Otherwise all resources including admission requests are mutated.
+Optional. Defaults to “false” if not specified.
Name is the name of the resource. The name supports wildcard characters
-“*” (matches zero or many characters) and “?” (at least one character).
+“*” (matches zero or many characters) and “?” (at least one character).
+NOTE: “Name” is being deprecated in favor of “Names”.
@@ -2231,8 +2261,7 @@ string
(Optional)
Names are the names of the resources. Each name supports wildcard characters
-“*” (matches zero or many characters) and “?” (at least one character).
-NOTE: “Name” is being deprecated in favor of “Names”.
+“*” (matches zero or many characters) and “?” (at least one character).