Skip to content

Commit

Permalink
Replaced deprecated generateExistingOnPolicyUpdate with generateExisting
Browse files Browse the repository at this point in the history
Signed-off-by: Pradeep Lakshmi Narasimha <[email protected]>
  • Loading branch information
praddy26 committed Sep 12, 2024
1 parent daeb299 commit 63119c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions content/en/docs/writing-policies/generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ spec:
apiVersion: networking.k8s.io/v1
name: deny-all-traffic
namespace: "{{request.object.metadata.name}}"
data:
data:
spec:
# select all pods in the namespace
podSelector: {}
Expand All @@ -128,7 +128,7 @@ spec:
For other examples of generate rules, see the [policy library](/policies/?policytypes=generate).

{{% alert title="Note" color="info" %}}
The field `spec.generateExistingOnPolicyUpdate` is no longer required for "classic" generate rules, is deprecated, and will be removed in an upcoming version.
The field `spec.generateExisting` is no longer required for "classic" generate rules, is deprecated, and will be removed in an upcoming version.
{{% /alert %}}

## Clone Source
Expand Down Expand Up @@ -267,7 +267,7 @@ spec:
apiVersion: rbac.authorization.k8s.io/v1
name: steven-rolebinding
namespace: "{{request.object.metadata.name}}"
data:
data:
subjects:
- kind: User
name: steven
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ metadata:
policies.kyverno.io/minversion: 1.7.0
kyverno.io/kubernetes-version: "1.23"
policies.kyverno.io/description: >-
This policy generates and synchronizes Argo CD cluster secrets from Rancher
This policy generates and synchronizes Argo CD cluster secrets from Rancher
managed cluster.provisioning.cattle.io/v1 resources and their corresponding CAPI secrets.
In this solution, Argo CD integrates with Rancher managed clusters via the central
Rancher authentication proxy which shares the network endpoint of the Rancher API/GUI.
The policy implements work-arounds for Argo CD issue https://github.com/argoproj/argo-cd/issues/9033
"Cluster-API cluster auto-registration" and Rancher issue https://github.com/rancher/rancher/issues/38053
"Fix type and labels Rancher v2 provisioner specifies when creating CAPI Cluster Secret".
spec:
generateExistingOnPolicyUpdate: true
generateExisting: true
rules:
- name: source-rancher-non-local-cluster-and-capi-secret
match:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ metadata:
required by the Kubeops Config Syncer for it to sync ConfigMaps/Secrets from
the Rancher management cluster to downstream clusters.
spec:
generateExistingOnPolicyUpdate: true
generateExisting: true
rules:
- name: source-rancher-non-local-cluster-and-capi-secret
match:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metadata:
is additional overhead. This policy creates a new NetworkPolicy for existing
Namespaces which results in a default deny behavior and labels it with created-by=kyverno.
spec:
generateExistingOnPolicyUpdate: true
generateExisting: true
rules:
- name: generate-existing-networkpolicy
match:
Expand Down

0 comments on commit 63119c9

Please sign in to comment.