1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

rename GenerateExistingOnPolicyUpdate to GenerateExisting (#6321)

Signed-off-by: ShutingZhao <shuting@nirmata.com>
This commit is contained in:
shuting 2023-03-03 17:34:55 +08:00 committed by GitHub
parent 29a70e0faf
commit 0b359d07db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 82 additions and 113 deletions

View file

@ -101,11 +101,11 @@ type Spec struct {
// +optional // +optional
MutateExistingOnPolicyUpdate bool `json:"mutateExistingOnPolicyUpdate,omitempty" yaml:"mutateExistingOnPolicyUpdate,omitempty"` MutateExistingOnPolicyUpdate bool `json:"mutateExistingOnPolicyUpdate,omitempty" yaml:"mutateExistingOnPolicyUpdate,omitempty"`
// GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources // GenerateExisting controls whether to trigger generate rule in existing resources
// If is set to "true" generate rule will be triggered and applied to existing matched resources. // If is set to "true" generate rule will be triggered and applied to existing matched resources.
// Defaults to "false" if not specified. // Defaults to "false" if not specified.
// +optional // +optional
GenerateExistingOnPolicyUpdate bool `json:"generateExistingOnPolicyUpdate,omitempty" yaml:"generateExistingOnPolicyUpdate,omitempty"` GenerateExisting bool `json:"generateExisting,omitempty" yaml:"generateExisting,omitempty"`
} }
func (s *Spec) SetRules(rules []Rule) { func (s *Spec) SetRules(rules []Rule) {
@ -212,9 +212,9 @@ func (s *Spec) GetMutateExistingOnPolicyUpdate() bool {
return s.MutateExistingOnPolicyUpdate return s.MutateExistingOnPolicyUpdate
} }
// IsGenerateExistingOnPolicyUpdate return GenerateExistingOnPolicyUpdate set value // IsGenerateExisting return GenerateExisting set value
func (s *Spec) IsGenerateExistingOnPolicyUpdate() bool { func (s *Spec) IsGenerateExisting() bool {
return s.GenerateExistingOnPolicyUpdate return s.GenerateExisting
} }
// GetFailurePolicy returns the failure policy to be applied // GetFailurePolicy returns the failure policy to be applied

View file

@ -63,11 +63,11 @@ type Spec struct {
// +optional // +optional
MutateExistingOnPolicyUpdate bool `json:"mutateExistingOnPolicyUpdate,omitempty" yaml:"mutateExistingOnPolicyUpdate,omitempty"` MutateExistingOnPolicyUpdate bool `json:"mutateExistingOnPolicyUpdate,omitempty" yaml:"mutateExistingOnPolicyUpdate,omitempty"`
// GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources // GenerateExisting controls whether to trigger generate rule in existing resources
// If is set to "true" generate rule will be triggered and applied to existing matched resources. // If is set to "true" generate rule will be triggered and applied to existing matched resources.
// Defaults to "false" if not specified. // Defaults to "false" if not specified.
// +optional // +optional
GenerateExistingOnPolicyUpdate bool `json:"generateExistingOnPolicyUpdate,omitempty" yaml:"generateExistingOnPolicyUpdate,omitempty"` GenerateExisting bool `json:"generateExisting,omitempty" yaml:"generateExisting,omitempty"`
} }
func (s *Spec) SetRules(rules []Rule) { func (s *Spec) SetRules(rules []Rule) {
@ -174,9 +174,9 @@ func (s *Spec) GetMutateExistingOnPolicyUpdate() bool {
return s.MutateExistingOnPolicyUpdate return s.MutateExistingOnPolicyUpdate
} }
// IsGenerateExistingOnPolicyUpdate return GenerateExistingOnPolicyUpdate set value // IsGenerateExisting return GenerateExisting set value
func (s *Spec) IsGenerateExistingOnPolicyUpdate() bool { func (s *Spec) IsGenerateExisting() bool {
return s.GenerateExistingOnPolicyUpdate return s.GenerateExisting
} }
// GetFailurePolicy returns the failure policy to be applied // GetFailurePolicy returns the failure policy to be applied

View file

@ -3503,11 +3503,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting
@ -10213,11 +10213,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting
@ -16682,11 +16682,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting
@ -23394,11 +23394,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting

View file

@ -101,11 +101,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting
@ -6811,11 +6811,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting

View file

@ -102,11 +102,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting
@ -6814,11 +6814,11 @@ spec:
- Ignore - Ignore
- Fail - Fail
type: string type: string
generateExistingOnPolicyUpdate: generateExisting:
description: GenerateExistingOnPolicyUpdate controls whether to trigger description: GenerateExisting controls whether to trigger generate
generate rule in existing resources If is set to "true" generate rule in existing resources If is set to "true" generate rule will
rule will be triggered and applied to existing matched resources. be triggered and applied to existing matched resources. Defaults
Defaults to "false" if not specified. to "false" if not specified.
type: boolean type: boolean
mutateExistingOnPolicyUpdate: mutateExistingOnPolicyUpdate:
description: MutateExistingOnPolicyUpdate controls if a mutateExisting description: MutateExistingOnPolicyUpdate controls if a mutateExisting

View file

@ -222,14 +222,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code></br> <code>generateExisting</code></br>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>
@ -447,14 +447,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code></br> <code>generateExisting</code></br>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>
@ -3347,14 +3347,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code></br> <code>generateExisting</code></br>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>

View file

@ -238,14 +238,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code><br/> <code>generateExisting</code><br/>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>
@ -464,14 +464,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code><br/> <code>generateExisting</code><br/>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>
@ -3332,14 +3332,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code><br/> <code>generateExisting</code><br/>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>
@ -5638,14 +5638,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code><br/> <code>generateExisting</code><br/>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>
@ -5863,14 +5863,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code><br/> <code>generateExisting</code><br/>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>
@ -6716,14 +6716,14 @@ Default value is &ldquo;false&rdquo;.</p>
</tr> </tr>
<tr> <tr>
<td> <td>
<code>generateExistingOnPolicyUpdate</code><br/> <code>generateExisting</code><br/>
<em> <em>
bool bool
</em> </em>
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>GenerateExistingOnPolicyUpdate controls whether to trigger generate rule in existing resources <p>GenerateExisting controls whether to trigger generate rule in existing resources
If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources. If is set to &ldquo;true&rdquo; generate rule will be triggered and applied to existing matched resources.
Defaults to &ldquo;false&rdquo; if not specified.</p> Defaults to &ldquo;false&rdquo; if not specified.</p>
</td> </td>

View file

@ -401,7 +401,7 @@ func applyRule(log logr.Logger, client dclient.Interface, rule kyvernov1.Rule, r
label := newResource.GetLabels() label := newResource.GetLabels()
// Add background gen-rule label if generate rule applied on existing resource // Add background gen-rule label if generate rule applied on existing resource
if policy.GetSpec().IsGenerateExistingOnPolicyUpdate() { if policy.GetSpec().IsGenerateExisting() {
label[LabelBackgroundGenRuleName] = rule.Name label[LabelBackgroundGenRuleName] = rule.Name
} }

View file

@ -21,16 +21,13 @@ func (pc *PolicyController) handleGenerate(policyKey string, policy kyvernov1.Po
logger := pc.log.WithName("handleGenerate").WithName(policyKey) logger := pc.log.WithName("handleGenerate").WithName(policyKey)
logger.Info("update URs on policy event") logger.Info("update URs on policy event")
generateURs := pc.listGenerateURs(policyKey, nil)
updateUR(pc.kyvernoClient, pc.urLister.UpdateRequests(config.KyvernoNamespace()), policyKey, generateURs, pc.log.WithName("updateUR"))
for _, rule := range policy.GetSpec().Rules { for _, rule := range policy.GetSpec().Rules {
if err := pc.createUR(policy, rule, false); err != nil { if err := pc.createURForDataRule(policy, rule, false); err != nil {
logger.Error(err, "failed to create UR on policy event") logger.Error(err, "failed to create UR on policy event")
} }
var ruleType kyvernov1beta1.RequestType var ruleType kyvernov1beta1.RequestType
if policy.GetSpec().IsGenerateExistingOnPolicyUpdate() { if policy.GetSpec().IsGenerateExisting() {
ruleType = kyvernov1beta1.Generate ruleType = kyvernov1beta1.Generate
triggers := generateTriggers(pc.client, rule, pc.log) triggers := generateTriggers(pc.client, rule, pc.log)
for _, trigger := range triggers { for _, trigger := range triggers {
@ -77,7 +74,7 @@ func (pc *PolicyController) createURForDownstreamDeletion(policy kyvernov1.Polic
for _, r := range rules { for _, r := range rules {
generateType, sync := r.GetGenerateTypeAndSync() generateType, sync := r.GetGenerateTypeAndSync()
if sync && (generateType == kyvernov1.Data) { if sync && (generateType == kyvernov1.Data) {
if err := pc.createUR(policy, r, true); err != nil { if err := pc.createURForDataRule(policy, r, true); err != nil {
errs = append(errs, err) errs = append(errs, err)
} }
} }
@ -85,7 +82,7 @@ func (pc *PolicyController) createURForDownstreamDeletion(policy kyvernov1.Polic
return multierr.Combine(errs...) return multierr.Combine(errs...)
} }
func (pc *PolicyController) createUR(policy kyvernov1.PolicyInterface, rule kyvernov1.Rule, deleteDownstream bool) error { func (pc *PolicyController) createURForDataRule(policy kyvernov1.PolicyInterface, rule kyvernov1.Rule, deleteDownstream bool) error {
generate := rule.Generation generate := rule.Generation
if !generate.Synchronize { if !generate.Synchronize {
// no action for non-sync policy/rule // no action for non-sync policy/rule

View file

@ -2,9 +2,7 @@ package policy
import ( import (
"context" "context"
"crypto/rand"
"fmt" "fmt"
"math/big"
"reflect" "reflect"
"time" "time"
@ -453,29 +451,3 @@ func generateTriggers(client dclient.Interface, rule kyvernov1.Rule, log logr.Lo
} }
return convertlist(list.Items) return convertlist(list.Items)
} }
func updateUR(kyvernoClient versioned.Interface, urLister kyvernov1beta1listers.UpdateRequestNamespaceLister, policyKey string, urList []*kyvernov1beta1.UpdateRequest, logger logr.Logger) {
for _, ur := range urList {
if policyKey == ur.Spec.GetPolicyKey() {
_, err := backgroundcommon.Update(kyvernoClient, urLister, ur.GetName(), func(ur *kyvernov1beta1.UpdateRequest) {
urLabels := ur.Labels
if len(urLabels) == 0 {
urLabels = make(map[string]string)
}
nBig, err := rand.Int(rand.Reader, big.NewInt(100000))
if err != nil {
logger.Error(err, "failed to generate random interger")
}
urLabels["policy-update"] = fmt.Sprintf("revision-count-%d", nBig.Int64())
ur.SetLabels(urLabels)
})
if err != nil {
logger.Error(err, "failed to update gr", "name", ur.GetName())
continue
}
if _, err := backgroundcommon.UpdateStatus(kyvernoClient, urLister, ur.GetName(), kyvernov1beta1.Pending, "", nil); err != nil {
logger.Error(err, "failed to set UpdateRequest state to Pending")
}
}
}
}

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: sync-with-multi-clone name: sync-with-multi-clone
spec: spec:
generateExistingOnPolicyUpdate: false generateExisting: false
rules: rules:
- name: sync-secret - name: sync-secret
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: sync-with-multi-clone-update name: sync-with-multi-clone-update
spec: spec:
generateExistingOnPolicyUpdate: false generateExisting: false
rules: rules:
- name: sync-secret - name: sync-secret
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: zk-kafka-address name: zk-kafka-address
spec: spec:
generateExistingOnPolicyUpdate: true generateExisting: true
rules: rules:
- name: k-kafka-address - name: k-kafka-address
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: zk-kafka-address name: zk-kafka-address
spec: spec:
generateExistingOnPolicyUpdate: false generateExisting: false
rules: rules:
- name: k-kafka-address - name: k-kafka-address
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: cpol-data-sync-delete-policy name: cpol-data-sync-delete-policy
spec: spec:
generateExistingOnPolicyUpdate: false generateExisting: false
rules: rules:
- name: cpol-data-sync-delete-rule - name: cpol-data-sync-delete-rule
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: zk-kafka-address name: zk-kafka-address
spec: spec:
generateExistingOnPolicyUpdate: true generateExisting: true
rules: rules:
- name: k-kafka-address - name: k-kafka-address
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: zk-kafka-address name: zk-kafka-address
spec: spec:
generateExistingOnPolicyUpdate: true generateExisting: true
rules: rules:
- name: k-kafka-address - name: k-kafka-address
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: existing-basic-create-data-policy name: existing-basic-create-data-policy
spec: spec:
generateExistingOnPolicyUpdate: true generateExisting: true
rules: rules:
- name: existing-basic-create-rule - name: existing-basic-create-rule
match: match:

View file

@ -3,7 +3,7 @@ kind: ClusterPolicy
metadata: metadata:
name: existing-basic-create-data-preconditions-policy name: existing-basic-create-data-preconditions-policy
spec: spec:
generateExistingOnPolicyUpdate: true generateExisting: true
rules: rules:
- name: existing-basic-create-data-preconditions-rule - name: existing-basic-create-data-preconditions-rule
match: match: