-
Notifications
You must be signed in to change notification settings - Fork 157
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
fix for duplicate entries in front-loadbalancer #11308
Conversation
for _, cidr := range data.Cluster().Spec.APIServerAllowedIPRanges.CIDRBlocks { | ||
if !slices.Contains(s.Spec.LoadBalancerSourceRanges, cidr) { | ||
s.Spec.LoadBalancerSourceRanges = append(s.Spec.LoadBalancerSourceRanges, cidr) | ||
} | ||
} |
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.
This can be solved by using apimaachinery's sets.String type to just create a string set from the cluster spec and then assining .List() to the service's spec. And for the other one ([]CIDRBlock) it might also be nice to use the string sets, just so we don't have one Go dependency just for slice.Contains.
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.
Thanks for the suggestion, taken care.
/lgtm |
LGTM label has been added. Git tree hash: 1c7d1f57a5391de5dcc635a3281fb92bda34e2ad
|
/retest |
/assign @xrstf |
Signed-off-by: Sachin Tiptur <sachin@kubermatic.com>
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.
/approve
LGTM label has been added. Git tree hash: 53bd8bf9a0445c78cffbb430094f5a5fa8460998
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sachintiptur, xrstf 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 |
/cherry-pick release/v2.21 |
/cherry-pick release/v2.20 |
/cherry-pick release/v2.19 |
@embik: #11308 failed to apply on top of branch "release/v2.21":
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. |
@embik: #11308 failed to apply on top of branch "release/v2.20":
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. |
@embik: #11308 failed to apply on top of branch "release/v2.19":
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. |
@sachintiptur it looks like this cannot be automatically backported. Since the original issue said it's present in 2.21, can you please take a look and backport this to all relevant and active release branches? Thanks! |
@sachintiptur ping, can you please confirm this doesn't need a backport to 2.19? |
Yes, it is not required in v2.19. |
Thanks! |
Signed-off-by: Sachin Tiptur sachin@kubermatic.com
What this PR does / why we need it:
Fixes the duplicate entry issue in front-loadbalancer service.
Which issue(s) this PR fixes:
Fixes # 11307
What type of PR is this?
/kind bug
Special notes for your reviewer:
Does this PR introduce a user-facing change? Then add your Release Note here:
Documentation: