-
Notifications
You must be signed in to change notification settings - Fork 331
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
Preserve webhook namespaceSelector.matchLabels #2605
Preserve webhook namespaceSelector.matchLabels #2605
Conversation
I have a webhook with this definition and the reconciler is removing the matchLabels field: Current resource: ``` namespaceSelector: matchExpressions: - key: webhooks.knative.dev/exclude operator: DoesNotExist objectSelector: matchLabels: app.kubernetes.io/component: kafka-dispatcher ``` Applied resource: ``` namespaceSelector: matchExpressions: [ ] matchLabels: app.kubernetes.io/name: knative-eventing objectSelector: matchLabels: app.kubernetes.io/component: kafka-dispatcher ``` Signed-off-by: Pierangelo Di Pilato <[email protected]>
Codecov ReportBase: 81.29% // Head: 81.30% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2605 +/- ##
=======================================
Coverage 81.29% 81.30%
=======================================
Files 162 162
Lines 9820 9824 +4
=======================================
+ Hits 7983 7987 +4
Misses 1597 1597
Partials 240 240
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
webhook/helper.go
Outdated
if len(current.MatchExpressions) == 0 { | ||
return want | ||
} |
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.
Dropping the return here has us always calling ensureLabelSelectorRequirements()
, which makes a new list of structs... not sure what the cost of that is (could be negligible), but should we consider keeping this block (and adding the MatchLabels
to the return) in order to bypass that call if it's not needed?
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.
Thank you! Done!
Signed-off-by: Pierangelo Di Pilato <[email protected]>
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.
The change post Paul's suggestion makes complete sense to me. Working through the logic pre-change was getting me a little confused -- thanks Paul!
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Not sure what's going on with EasyCLA right now |
Yeah, seems to be having problems in all knative/* repos except func |
/easycla |
I have a webhook with this definition and the reconciler is removing the
namespaceSelector.matchLabels
field:Current resource:
Applied resource:
Signed-off-by: Pierangelo Di Pilato [email protected]
Changes
/kind bug
Release Note