-
Notifications
You must be signed in to change notification settings - Fork 784
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: skip rules without operation in resource webhook creation #10146
fix: skip rules without operation in resource webhook creation #10146
Conversation
Thanks for opening your first Pull Request here! Please check out our Contributing guidelines and confirm that you Signed off. |
8b485ef
to
6d50b08
Compare
Hi @snorwin - thanks for the fix. Can you also attach the configured mutatingwebhookconfigurations and validatingwebhookconfigurations for the policy with generate and mutate rules? |
/cherry-pick release-1.12 |
The policy:
generated resource webhook configurations:
|
Why there's an extra rule for namespaces in mutating webhook?
|
|
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
6d50b08
to
6bc7dda
Compare
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
The linter check fails, @snorwin - can you fix it https://github.com/kyverno/kyverno/actions/runs/8897683625/job/24433129022?pr=10146? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10146 +/- ##
==========================================
+ Coverage 10.13% 10.15% +0.02%
==========================================
Files 1030 1030
Lines 91776 91779 +3
==========================================
+ Hits 9299 9321 +22
+ Misses 81461 81439 -22
- Partials 1016 1019 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
1e34e4b
to
1143762
Compare
Congratulations! 🎉Great job merging your first Pull Request here! How awesome! If you are new to this project, feel free to join our Slack community |
* fix: skip rules without operation in resource webhook creation Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> * test: add unit test for buildRulesWithOperations Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> * fix liniting issues Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> --------- Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
… (#10151) * fix: skip rules without operation in resource webhook creation * test: add unit test for buildRulesWithOperations * fix liniting issues --------- Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> Co-authored-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
…no#10146) (kyverno#10151) * fix: skip rules without operation in resource webhook creation * test: add unit test for buildRulesWithOperations * fix liniting issues --------- Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> Co-authored-by: Norwin Schnyder <norwin.schnyder+github@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
Explanation
The error
MutatingWebhookConfiguration: webhooks[0].rules[0].operations: Required value
occurs when using mutating and generating rules in the same policy.Related issue
Fixes #10143 .
Milestone of this PR
/milestone 1.12.1
What type of PR is this
/kind bug
Proposed Changes
Add a check in order to skip rules without any mapped operation.
Checklist