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

uniq function should compare more than NodePort difference #402

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

freehan
Copy link
Contributor

@freehan freehan commented Jul 17, 2018

cc: @agau4779

@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 Jul 17, 2018
func uniq(svcPorts []utils.ServicePort) []utils.ServicePort {
portMap := map[string]utils.ServicePort{}
for _, p := range svcPorts {
portMap[fmt.Sprintf("%q-%q-%q", p.ID.Service.Namespace, p.ID.Service.Name, p.ID.Port.String())] = p
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably define a String() for ServicePortID while we're at it.

func (id ServicePortID) String() string {
   return fmt.Sprintf("%v/%v", id.Service.String(), id.Port.String())
}

yielding kube-system/default-backend/http

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Fixed.

@freehan freehan force-pushed the uniq-bug-fix2 branch 3 times, most recently from 3acbb13 to a4427d2 Compare July 17, 2018 22:18
@nicksardo
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2018
@nicksardo nicksardo merged commit 5ac6cd6 into kubernetes:master Jul 17, 2018
nicksardo added a commit that referenced this pull request Jul 18, 2018
cherrypick #402 to release-1.2 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants