Skip to content

Restrict subnet auto-discovery to new LB creation only #2125

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

Merged

Conversation

oliviassss
Copy link
Collaborator

@oliviassss oliviassss commented Jul 14, 2021

Issue

#2056

Description

Restrict the subnet auto-discovery to new load balancer creation on ingress side.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

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

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 14, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @oliviassss!

It looks like this is your first PR to kubernetes-sigs/aws-load-balancer-controller 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-load-balancer-controller has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @oliviassss. 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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 14, 2021
@k8s-ci-robot k8s-ci-robot requested review from kishorj and M00nF1sh July 14, 2021 20:59
@oliviassss oliviassss changed the title Olivia/subnet discovery Restrict subnet auto-discovery to new LB creation only Jul 14, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #2125 (590c230) into main (9f4eae5) will increase coverage by 0.06%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2125      +/-   ##
==========================================
+ Coverage   49.52%   49.59%   +0.06%     
==========================================
  Files         130      130              
  Lines        7065     7084      +19     
==========================================
+ Hits         3499     3513      +14     
- Misses       3284     3287       +3     
- Partials      282      284       +2     
Impacted Files Coverage Δ
pkg/ingress/model_builder.go 62.34% <50.00%> (-0.32%) ⬇️
pkg/ingress/model_build_load_balancer.go 50.86% <69.23%> (+2.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f4eae5...590c230. Read the comment docs.

@kishorj
Copy link
Collaborator

kishorj commented Jul 14, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 14, 2021
LoadBalancerArn: awssdk.String("lb-1"),
AvailabilityZones: []*elbv2sdk.AvailabilityZone{
{
SubnetId: awssdk.String("subnet-a"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use different subnet names in this case? I see 'subnet-a' and 'subnet-b' are used for other tests as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to 'subnet-e' and 'subent-f' in this case.

ctrl := gomock.NewController(t)
defer ctrl.Finish()

elbv2Client := services.NewMockELBV2(ctrl)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use MockTaggingManager instead? The tests are simpler that way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your advice. Have changed to use MockTaggingManager.

@oliviassss oliviassss force-pushed the olivia/subnet_discovery branch from 590c230 to 5d0d12f Compare July 15, 2021 06:44
@oliviassss oliviassss force-pushed the olivia/subnet_discovery branch from 5d0d12f to 36196e1 Compare July 15, 2021 06:50
@kishorj kishorj added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jul 15, 2021
@kishorj
Copy link
Collaborator

kishorj commented Jul 15, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 15, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kishorj, oliviassss

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 15, 2021
@k8s-ci-robot k8s-ci-robot merged commit 4982070 into kubernetes-sigs:main Jul 15, 2021
Timothy-Dougherty pushed a commit to adammw/aws-load-balancer-controller that referenced this pull request Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants