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 support for hostname annotation in ingress resource #545

Merged
merged 2 commits into from
May 8, 2018
Merged

add support for hostname annotation in ingress resource #545

merged 2 commits into from
May 8, 2018

Conversation

rajatjindal
Copy link
Contributor

This PR fixes #402

We ran into similar issue where we had ingress rule hostname set to 'website.company.com' whereas the externaldns name we wanted was 'website.extdomain.company.com'

and website.company.com is a static cname to website.extdomain.company.com

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 6, 2018
@rajatjindal
Copy link
Contributor Author

/retest

@@ -232,6 +232,15 @@ func endpointsFromIngress(ing *v1beta1.Ingress) []*endpoint.Endpoint {
}
endpoints = append(endpoints, endpointsForHostname(rule.Host, targets, ttl)...)
}

if ing.Annotations[hostnameAnnotationKey] != "" {
hostnames := strings.Split(ing.Annotations[hostnameAnnotationKey], ",")
Copy link
Contributor

Choose a reason for hiding this comment

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

the logic differs from https://github.com/kubernetes-incubator/external-dns/blob/68be609648b43dc067926979891bf5eb468b0dd3/source/service.go#L189, we should make it consistent (e.g. the code in service.go removes whitespace anywhere

Maybe extract into a new function and use it in both places?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 8, 2018
@rajatjindal
Copy link
Contributor Author

Hi @hjacobs

thank you for reviewing the code. I've made the suggested changes.

seems like the build is failing due to timeout, I tried running on my laptop, it works just fine.

can you please review again, and let me know if it looks ok now.

Thanks
Rajat Jindal

@hjacobs
Copy link
Contributor

hjacobs commented May 8, 2018

@rajatjindal I just merged #548 which fixes the timeout problem with linters during the build --- if you rebase your PR, it should work 😄

@rajatjindal
Copy link
Contributor Author

@hjacobs rebase done, and that fixed the build too. thanks

@hjacobs
Copy link
Contributor

hjacobs commented May 8, 2018

@linki @njuettner please have a quick look. LGTM.

@linki
Copy link
Member

linki commented May 8, 2018

LGTM, thanks 👍

@linki linki added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 8, 2018
@hjacobs hjacobs merged commit c2751f8 into kubernetes-sigs:master May 8, 2018
@rajatjindal rajatjindal deleted the ingress-hostname branch October 10, 2019 05:46
lou-lan pushed a commit to lou-lan/external-dns that referenced this pull request May 11, 2022
* Add index add command

* Add validation around number of args

* Prevent adding index if name is already used

* Most code review changes

Add success case to unit test and add initial integration test for index
command

* Update unit test

Remove test table to make it easier to read and split into separate
tests for failure and success cases

* Code review changes

* Check migration error

* Code review changes

* Code review changes

Print empty index list and convert valid index name to use test tables

* Update integration_test/index_test.go

Co-Authored-By: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>

* Check number of lines in index integration test

* Code review changes

Use ListIndexes in add test and fix error message

Co-authored-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
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.

hostname annotation with ingress resource
4 participants