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

Merge the logic of ToUrlMap() and IngressToNodePorts() #257

Conversation

rramkumar1
Copy link
Contributor

@rramkumar1 rramkumar1 commented May 9, 2018

This PR attempts to merge the logic of two function in the translator. Right now, ToUrlMap() and IngressToNodePorts() both iterate over an Ingress spec in very similar ways. In order to reduce complexity of having two similar code paths being executed at different times, we can merge these two functions together to ensure easier testing and maintainability.

This also gives us the opportunity to store all config in one place (GCEURLMap). Now, this struct uses a ServicePort to denote a backend rather than the backend's name. (credit to @nicksardo for this idea)

If this approach looks reasonable, I will add tests for it (there are no tests for any of this currently).

This PR is a prerequisite for condensing backend pool's (#242).

/assign @nicksardo

@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 May 9, 2018
@rramkumar1 rramkumar1 changed the title Merge the logic of ToUrlMap() and IngressToNodePorts() Merge the logic of ToUrlMap() and IngressToNodePorts() [WIP] May 9, 2018
@rramkumar1 rramkumar1 force-pushed the merge-getting-svcports-with-urlmap-translation branch from e886587 to b55bd52 Compare May 10, 2018 16:11
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 10, 2018
@rramkumar1 rramkumar1 force-pushed the merge-getting-svcports-with-urlmap-translation branch from b55bd52 to 00c3f96 Compare May 10, 2018 16:14
@rramkumar1
Copy link
Contributor Author

rramkumar1 commented May 10, 2018

Note: A bulk of the changes are to tests and the result of moving ServicePort to the utils package.

@rramkumar1 rramkumar1 force-pushed the merge-getting-svcports-with-urlmap-translation branch from 00c3f96 to d018477 Compare May 10, 2018 16:17
@rramkumar1 rramkumar1 force-pushed the merge-getting-svcports-with-urlmap-translation branch from d018477 to 26af836 Compare May 10, 2018 16:22
@nicksardo
Copy link
Contributor

Thanks for making the changes.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 10, 2018
@nicksardo nicksardo merged commit a0023fb into kubernetes:master May 10, 2018
@rramkumar1 rramkumar1 changed the title Merge the logic of ToUrlMap() and IngressToNodePorts() [WIP] Merge the logic of ToUrlMap() and IngressToNodePorts() May 17, 2018
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants