-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
add more testing for mergeAlternativeBackends #3446
add more testing for mergeAlternativeBackends #3446
Conversation
@clandry94 could you rebase with master? |
748654a
to
81849d0
Compare
} | ||
|
||
return false | ||
} |
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.
you can simply do
return primary.Name != alternative.Name && !primary.NoServer
} | ||
|
||
// Performs the merge action and checks to ensure that one two alternative backends do not merge into each other | ||
func mergeAlternativeBackend(priUps *ingress.Backend, altUps *ingress.Backend) bool { |
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.
Why are you referring backends as upstreams? When you log below you correctly call them alternative and primary backend.
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.
Never mind - looks like they're interchangeably used everywhere in this file. We can revisit this later.
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.
however it'd be great if you can make the signature of this function consistent with https://github.com/kubernetes/ingress-nginx/pull/3446/files#diff-86ac9ff9d75a0c5005c116e766a6127dR1118
- fix edge cases caught by new testing
81849d0
to
988189c
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clandry94, ElvinEfendi 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 |
I've retried CI several times already maybe rebase with master and see if it helps since #3488 is merged. |
What this PR does / why we need it:
This adds more tests for the merge function when creating alternative backends. It also covers the scenarios where an alternative ingress merges with itself, which was fixed in #3417
I also fixed a few edge cases I found while adding the new tests.
Special notes for your reviewer: