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

add more testing for mergeAlternativeBackends #3446

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

clandry94
Copy link

@clandry94 clandry94 commented Nov 20, 2018

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:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 20, 2018
@ElvinEfendi
Copy link
Member

@clandry94 could you rebase with master?

@clandry94 clandry94 force-pushed the add_tests_merge_canary branch 4 times, most recently from 748654a to 81849d0 Compare November 23, 2018 18:09
}

return false
}
Copy link
Member

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

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.

Copy link
Member

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.

Copy link
Member

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

/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 Nov 30, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /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 Nov 30, 2018
@ElvinEfendi
Copy link
Member

I've retried CI several times already maybe rebase with master and see if it helps since #3488 is merged.

@k8s-ci-robot k8s-ci-robot merged commit 24f3e50 into kubernetes:master Nov 30, 2018
@ElvinEfendi ElvinEfendi deleted the add_tests_merge_canary branch December 3, 2018 15:41
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants