kubernetes-sigs / aws-load-balancer-controller

A Kubernetes controller for Elastic Load Balancers
https://kubernetes-sigs.github.io/aws-load-balancer-controller/
Apache License 2.0
3.95k stars 1.47k forks source link

bug fix: try SG permission add prior to revoke #3952

Open zac-nixon opened 17 hours ago

zac-nixon commented 17 hours ago

Issue

https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/3822

Description

As described in the issue, it's possible for a user to incorrectly configure their SG rules in such a way that the controller leaves the SG in a state that doesn't allow traffic. This PR solves the issue by reversing the order of operations such that instead allowing too few traffic we allow too much traffic (in the worse case). This way customers who mis-configure their SG rules don't risk a full outage.

I also backfilled missing test cases in the SG resolver.

Test cases tried:

Checklist

BONUS POINTS checklist: complete for good vibes and maybe prizes?! :exploding_head:

k8s-ci-robot commented 17 hours ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zac-nixon Once this PR has been reviewed and has the lgtm label, please assign kishorj for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
k8s-ci-robot commented 17 hours ago

Hi @zac-nixon. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.