-
Notifications
You must be signed in to change notification settings - Fork 431
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 webhook for CNI overlay #4097
Conversation
/cherry-pick release-1.11 |
@nojnhuh: once the present PR merges, I will cherry-pick it on top of release-1.11 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4097 +/- ##
=======================================
Coverage 57.61% 57.61%
=======================================
Files 188 188
Lines 19200 19202 +2
=======================================
+ Hits 11062 11064 +2
Misses 7507 7507
Partials 631 631
☔ View full report in Codecov by Sentry. |
@@ -1583,6 +1584,29 @@ func TestAzureManagedControlPlane_ValidateUpdate(t *testing.T) { | |||
}, | |||
wantErr: false, | |||
}, | |||
{ | |||
name: "NetworkPolicy is allowed when NetworkPluginMode is not changed", |
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.
There's a permutation we're not covering in UT:
- Old = some NetworkPolicy + overlay NetworkPlugin
- New = some different NetworkPolicy + overlay NetworkPlugin
I assume that AKS would reject that update, do we have the right webhooks to optimize for CAPZ UX?
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.
We already have webhook and test coverage for the immutability of NetworkPlugin which isn't affected by the value of NetworkPluginMode. Or do you think it's worth checking to see if some updates might actually be allowed when overlay is enabled?
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.
s/NetworkPlugin/NetworkPolicy/
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 subtlety of this change just makes me want to cover every (potentially) artificial scenario.
If we're fixing a specific use case let's just ship this and then we can watch closely and fine-tune our webhooks as we observe edge cases. We're already in a place where the actual behaviors don't match AKS documentation so I think we're probably just gonna have to be reactive. :/
/lgtm |
LGTM label has been added. Git tree hash: 2372ae2c7e2111ad15d566415527ab317bdc8739
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jackfrancis 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 |
@nojnhuh: failed to push cherry-picked changes in GitHub: pushToNamedFork is not implemented in the v2 client In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-1.11 |
@nojnhuh: failed to push cherry-picked changes in GitHub: pushToNamedFork is not implemented in the v2 client In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind bug
/area managedclusters
What this PR does / why we need it:
This PR fixes a bug in the AzureManagedControlPlane update webhook when checking
spec.networkPluginMode
. The intent is to disallow changing thenetworkPluginMode
tooverlay
whenspec.networkPolicy
is already enabled without overlay. The bug was disallowing updates to AzureManagedControlPlane wheneveroverlay
is specified andnetworkPolicy
was specified without verifying that the update modifiesnetworkPluginMode
.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #4093
Special notes for your reviewer:
TODOs:
Release note: