-
Notifications
You must be signed in to change notification settings - Fork 578
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
Save Nat Gateways IPs to status on every reconciliation #4508
Save Nat Gateways IPs to status on every reconciliation #4508
Conversation
Hi @fiunchinho. 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. |
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.
/ok-to-test
@@ -69,6 +69,7 @@ func (s *Service) reconcileNatGateways() error { | |||
return err | |||
} | |||
|
|||
var natGatewaysIPs []string |
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.
For consistency with the next line
var natGatewaysIPs []string | |
natGatewaysIPs := []string{} |
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.
Alternatively, the line could change to the var declaration. :)
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.
Especially because it looks like it could be empty, so no need to pre-initialize it.
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.
Why is one way preferred over the other? Isn't it a empty slice in both cases?
/test pull-cluster-api-provider-aws-e2e-eks |
/test pull-cluster-api-provider-aws-e2e |
@fiunchinho did you test locally to check the status field for NAT gateway IP? |
Yes, it's saving the IPs on the status field. But the controller is logging errors, because the ingress rules are being wrongly modified by a bug that it's fixed here #4359 |
212e934
to
0413cf5
Compare
0413cf5
to
c27e4fd
Compare
/test pull-cluster-api-provider-aws-e2e |
/test pull-cluster-api-provider-aws-e2e |
@fiunchinho: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
@fiunchinho we can ignore this test failure, it's not related to your change /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ankitasw 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 |
/cherrypick release-2.2 |
@richardcase: new pull request created: #4520 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:
When we first create the nat gateways, they go to the
Pending
state. At that point, they don't have a PublicIP just yet. So if we only save the nat gateway public IP to thestatus
field right after creating the nat gateway, we won't have the public IP available, meaning we won't be able to save it to the status.Now the logic is changed so we always save the NAT Gateways IPs to the status field.
Special notes for your reviewer:
I've tested this version in our management clusters, adding our custom ingress rules and it all worked fine.
There was a missmatch in how the ingress rules were modeled in CAPA and the SDK, making the controller to keep reconciliating the same AWSCluster because the
SecurityGroups
saved in the field.status.networkStatus.securityGroups
never matched the security groups returned by the AWS SDK. Now they match and no extra reconciliations are needed.Checklist:
Release note: