-
Notifications
You must be signed in to change notification settings - Fork 430
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
allow setting the NatGateway name if it's empty when update AzureCluster #3551
allow setting the NatGateway name if it's empty when update AzureCluster #3551
Conversation
Hi @xiujuanx. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
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.
/lgtm
LGTM label has been added. Git tree hash: 407a5a378361b1c4248905153cfe592be21b5da8
|
@xiujuanx - can you add a release note please? |
/cherry-pick release-1.9 |
@CecileRobertMichon: once the present PR merges, I will cherry-pick it on top of release-1.9 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. |
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.
/lgtm
/assign @sonasingh46 @willie-yao
Another one to look into why the upgrade test didn't catch it
@@ -168,7 +168,7 @@ func (c *AzureCluster) validateSubnetUpdate(old *AzureCluster) field.ErrorList { | |||
c.Spec.NetworkSpec.Subnets[i].RouteTable.Name, "field is immutable"), | |||
) | |||
} | |||
if subnet.NatGateway.Name != oldSubnet.NatGateway.Name { | |||
if (subnet.NatGateway.Name != oldSubnet.NatGateway.Name) && (oldSubnet.NatGateway.Name != "") { |
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.
nit: we could use webhookutils.ValidateZeroTransition
for this
but I see we're not doing this consistently in this current file so also good with merging this as is for now
@CecileRobertMichon is the cluster scenario we're using in the upgrade test using NatGateway? |
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.
/lgtm
The upgrade test upgrades from the v1.0.2 default prow template, which includes the natgateway. However, the latest version of the prow template does not have the natgateway field, which is probably why this test didn't catch it: v1.0.2 template: https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/test/e2e/data/infrastructure-azure/v1.0.2/cluster-template-prow.yaml |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon 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 |
@CecileRobertMichon: new pull request created: #3554 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
What this PR does / why we need it:
Now, we default use the NAT gateway for the node outbound connection if cluster is not using IPv6. So we should allow setting the NatGateway name if it's empty when update AzureCluster.
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 #
The AzureCluster webhook is validating if the old gateway name is same with the new gateway name when update:
If they are different, then below error will happen:
This error is expected if a NatGateway has created before upgrade.
But the current situation is the NatGateway name is empty, then we will generate a new one default. This makes the old NatGateway name is different with the new one, so webhook complains error. This is not expected. We should allow setting the NatGateway name if it's empty when update AzureCluster
Special notes for your reviewer:
TODOs:
Release note: