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

fix for duplicate entries in front-loadbalancer #11308

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

sachintiptur
Copy link
Contributor

@sachintiptur sachintiptur commented Nov 7, 2022

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:

Fix duplicate SourceRange entries for front-loadbalancer Service

Documentation:

NONE

@kubermatic-bot kubermatic-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. docs/none Denotes a PR that doesn't need documentation (changes). release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. labels Nov 7, 2022
Comment on lines 430 to 432
for _, cidr := range data.Cluster().Spec.APIServerAllowedIPRanges.CIDRBlocks {
if !slices.Contains(s.Spec.LoadBalancerSourceRanges, cidr) {
s.Spec.LoadBalancerSourceRanges = append(s.Spec.LoadBalancerSourceRanges, cidr)
}
}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@sachintiptur sachintiptur changed the title WIP: fix for duplicate entries in front-loadbalancer fix for duplicate entries in front-loadbalancer Nov 8, 2022
@kubermatic-bot kubermatic-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 8, 2022
@rastislavs
Copy link
Contributor

/lgtm

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1c7d1f57a5391de5dcc635a3281fb92bda34e2ad

@sachintiptur
Copy link
Contributor Author

/retest

@sachintiptur
Copy link
Contributor Author

/assign @xrstf

Signed-off-by: Sachin Tiptur <sachin@kubermatic.com>
@kubermatic-bot kubermatic-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 9, 2022
Copy link
Contributor

@xrstf xrstf left a comment

Choose a reason for hiding this comment

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

/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 9, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 53bd8bf9a0445c78cffbb430094f5a5fa8460998

@kubermatic-bot
Copy link
Contributor

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

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 9, 2022
@kubermatic-bot kubermatic-bot merged commit 8f024ba into kubermatic:main Nov 9, 2022
@embik embik added the backport-needed Denotes a PR or issue that has not been fully backported. label Nov 14, 2022
@embik
Copy link
Member

embik commented Nov 14, 2022

/cherry-pick release/v2.21

@embik
Copy link
Member

embik commented Nov 14, 2022

/cherry-pick release/v2.20

@embik
Copy link
Member

embik commented Nov 14, 2022

/cherry-pick release/v2.19

@kubermatic-bot
Copy link
Contributor

@embik: #11308 failed to apply on top of branch "release/v2.21":

Applying: fix for duplicate entries in front-loadbalancer
Using index info to reconstruct a base tree...
M	pkg/resources/nodeportproxy/nodeportproxy.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/resources/nodeportproxy/nodeportproxy.go
CONFLICT (content): Merge conflict in pkg/resources/nodeportproxy/nodeportproxy.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix for duplicate entries in front-loadbalancer
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release/v2.21

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.

@kubermatic-bot
Copy link
Contributor

@embik: #11308 failed to apply on top of branch "release/v2.20":

Applying: fix for duplicate entries in front-loadbalancer
Using index info to reconstruct a base tree...
M	pkg/resources/nodeportproxy/nodeportproxy.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/resources/nodeportproxy/nodeportproxy.go
CONFLICT (content): Merge conflict in pkg/resources/nodeportproxy/nodeportproxy.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix for duplicate entries in front-loadbalancer
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release/v2.20

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.

@kubermatic-bot
Copy link
Contributor

@embik: #11308 failed to apply on top of branch "release/v2.19":

Applying: fix for duplicate entries in front-loadbalancer
Using index info to reconstruct a base tree...
M	pkg/resources/nodeportproxy/nodeportproxy.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/resources/nodeportproxy/nodeportproxy.go
CONFLICT (content): Merge conflict in pkg/resources/nodeportproxy/nodeportproxy.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix for duplicate entries in front-loadbalancer
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release/v2.19

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
Copy link
Member

embik commented Nov 14, 2022

@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!

@kubermatic-bot kubermatic-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 16, 2022
@embik
Copy link
Member

embik commented Dec 8, 2022

@sachintiptur ping, can you please confirm this doesn't need a backport to 2.19?

@sachintiptur
Copy link
Contributor Author

@sachintiptur ping, can you please confirm this doesn't need a backport to 2.19?

Yes, it is not required in v2.19.

@embik
Copy link
Member

embik commented Dec 8, 2022

Thanks!

@embik embik added backport-complete Denotes a PR or issue which has been fully backported to all required release branches. and removed backport-needed Denotes a PR or issue that has not been fully backported. labels Dec 8, 2022
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. backport-complete Denotes a PR or issue which has been fully backported to all required release branches. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants