-
Notifications
You must be signed in to change notification settings - Fork 776
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
fix: invoke cleanup process during shutdown #5974
Conversation
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Codecov Report
@@ Coverage Diff @@
## main #5974 +/- ##
==========================================
- Coverage 35.93% 35.89% -0.04%
==========================================
Files 192 192
Lines 21037 21060 +23
==========================================
Hits 7560 7560
- Misses 12643 12666 +23
Partials 834 834
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
/cherry-pick release-1.9 |
ManagedByLabel = "webhook.kyverno.io/managed-by" | ||
KyvernoComponentLabel = "app.kubernetes.io/component" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it's the best place to define those new const.
Not a blocker, we can change later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quickly looked at it, looks ok.
Did you test it ?
Yes, both scaling down to zero and helm uninstall:) |
* invoke cleanup process during shutdown Signed-off-by: ShutingZhao <shuting@nirmata.com> * fix shutdown cleanup Signed-off-by: ShutingZhao <shuting@nirmata.com> * fix shutdown panic Signed-off-by: ShutingZhao <shuting@nirmata.com> * cleanup webhooks by the label Signed-off-by: ShutingZhao <shuting@nirmata.com> Signed-off-by: ShutingZhao <shuting@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* invoke cleanup process during shutdown Signed-off-by: ShutingZhao <shuting@nirmata.com> * fix shutdown cleanup Signed-off-by: ShutingZhao <shuting@nirmata.com> * fix shutdown panic Signed-off-by: ShutingZhao <shuting@nirmata.com> * cleanup webhooks by the label Signed-off-by: ShutingZhao <shuting@nirmata.com> Signed-off-by: ShutingZhao <shuting@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Signed-off-by: ShutingZhao <shuting@nirmata.com> Co-authored-by: shuting <shuting@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
* invoke cleanup process during shutdown Signed-off-by: ShutingZhao <shuting@nirmata.com> * fix shutdown cleanup Signed-off-by: ShutingZhao <shuting@nirmata.com> * fix shutdown panic Signed-off-by: ShutingZhao <shuting@nirmata.com> * cleanup webhooks by the label Signed-off-by: ShutingZhao <shuting@nirmata.com> Signed-off-by: ShutingZhao <shuting@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Signed-off-by: MdSahil-oss <Mohdssahil1@gmail.com>
Signed-off-by: ShutingZhao shuting@nirmata.com
Explanation
This PR cleans up Kyverno managed resources (leases, *webhookconfigurations) and fixes the shutdown panic. The webhooks' owner is set to clusterrole
kyverno:webhook
to deal with Helm uninstall where kyverno lost permission to perform such cleanup.Related issue
Closes #5942.
Closes #5355.
Milestone of this PR
/1.9.0
What type of PR is this
/bug
Proposed Changes
Proof Manifests
Checklist
Further Comments