Skip to content
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

refactor backend SG provider #2836

Merged
merged 4 commits into from
Apr 24, 2023

Conversation

kishorj
Copy link
Collaborator

@kishorj kishorj commented Oct 18, 2022

Issue

Refactor SG provider modules

Description

The controller currently cleans up auto-allocated backend SG only if there are no active ingress resources managed by the controller. This change causes the lb controller to delete the backend SG as soon as there are no active ingresses requiring automatic SG rules configuration. Also refactor the SG resolver code from the model builder.

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 Oct 18, 2022
@kishorj kishorj requested a review from M00nF1sh October 18, 2022 17:56
@kishorj kishorj added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Oct 18, 2022
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 18, 2022
pkg/networking/backend_sg_provider.go Outdated Show resolved Hide resolved
pkg/networking/backend_sg_provider.go Outdated Show resolved Hide resolved
pkg/networking/backend_sg_provider.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 24, 2023
return true, errors.Wrapf(err, "unable to list ingresses")
}
for _, ing := range ingList.Items {
if !p.checkIngressFinalizersFunc(ing.GetFinalizers()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

wondering whether there could be race conditions.

Copy link
Collaborator

@M00nF1sh M00nF1sh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
discussed with kishor, we will take action items to address the comments as follow-ups

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 21, 2023
@kishorj
Copy link
Collaborator Author

kishorj commented Apr 22, 2023

/retest

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 76.99% and project coverage change: +0.31 🎉

Comparison is base (4cf7c33) 54.73% compared to head (017b94a) 55.05%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2836      +/-   ##
==========================================
+ Coverage   54.73%   55.05%   +0.31%     
==========================================
  Files         145      148       +3     
  Lines        8479     8532      +53     
==========================================
+ Hits         4641     4697      +56     
- Misses       3503     3505       +2     
+ Partials      335      330       -5     
Impacted Files Coverage Δ
pkg/deploy/elbv2/listener_manager.go 1.08% <ø> (ø)
pkg/k8s/utils.go 50.00% <0.00%> (-50.00%) ⬇️
pkg/networking/backend_sg_provider_mocks.go 0.00% <0.00%> (ø)
pkg/networking/security_group_resolver_mocks.go 0.00% <0.00%> (ø)
pkg/ingress/model_build_load_balancer.go 72.24% <60.00%> (+3.76%) ⬆️
pkg/ingress/model_builder.go 69.08% <60.00%> (-0.19%) ⬇️
pkg/networking/security_group_resolver.go 93.47% <93.47%> (ø)
pkg/networking/backend_sg_provider.go 93.83% <97.36%> (+2.63%) ⬆️
pkg/ingress/class.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@M00nF1sh M00nF1sh left a comment

Choose a reason for hiding this comment

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

/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 Apr 24, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

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. size/XXL Denotes a PR that changes 1000+ 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.

5 participants