Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] Kyverno should not delete downstream resources when a generate policy using the clone behavior has synchronize: true #1401

Closed
chipzoller opened this issue Dec 16, 2020 · 2 comments · Fixed by #1880
Assignees
Labels
enhancement New feature or request

Comments

@chipzoller
Copy link
Member

Is your feature request related to a problem? Please describe.
When a generate rule which matches on Namespaces contains a reference to an existing resource via the clone statement, any matching new Namespaces gets a clone of this source object. But if the policy containing this rule is deleted, if synchronize: true is set on the rule, the downstream (synchronized) resources across all extant Namespaces will be immediately deleted.

Describe the solution you'd like
This behavior should be altered to leave the downstream resources intact should the policy be deleted.

Additional context
For generate rules which specify the data directive and therefore define the object definition in the rule itself, deletion of the parent policy should continue to delete the downstream resources when synchronize: true. In these cases, the source of truth is the policy.

@NoSkillGirl
Copy link
Contributor

@chipzoller - Currently, if any changes is done to the source resource, same changes are expected in the cloned resource.
What about after deleting the generate policy. Should the generated resource change according to the source resource or not?

@chipzoller
Copy link
Member Author

chipzoller commented May 5, 2021

EDIT: Removed previous line because I thought I was commenting on the PR.

What about after deleting the generate policy. Should the generated resource change according to the source resource or not?

Since the policy was deleted, and that policy was the thing that specified synchronization, should the source resource be changed those changes should not be propagated downstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants