Address remove comments

This commit is contained in:
dan.simone@oracle.com 2021-04-14 13:21:03 -07:00
parent a70d8010b5
commit 03c3c8fcb8
3 changed files with 4 additions and 5 deletions

View File

@ -297,10 +297,10 @@ func endpointsFromIngress(ing *v1beta1.Ingress, ignoreHostnameAnnotation bool, i
// Include endpoints according to the hostname source annotation in our final list
var endpoints []*endpoint.Endpoint
if strings.ToLower(hostnameSourceAnnotation) != IngressHostnameSourceAnnotationOnlyValue {
if strings.ToLower(hostnameSourceAnnotation) == IngressHostnameSourceDefinedHostsOnlyValue {
endpoints = append(endpoints, definedHostsEndpoints...)
}
if strings.ToLower(hostnameSourceAnnotation) != IngressHostnameSourceDefinedHostsOnlyValue {
if strings.ToLower(hostnameSourceAnnotation) == IngressHostnameSourceAnnotationOnlyValue {
endpoints = append(endpoints, annotationEndpoints...)
}
return endpoints

View File

@ -268,10 +268,10 @@ func testEndpointsFromIngressHostnameSourceAnnotation(t *testing.T) {
},
},
{
title: "Ingress-hostname-source=all, one rule.host, one annotation host",
title: "No ingress-hostname-source annotation, one rule.host, one annotation host",
ingress: fakeIngress{
dnsnames: []string{"foo.bar"},
annotations: map[string]string{hostnameAnnotationKey: "foo.baz", ingressHostnameSourceKey: "all"},
annotations: map[string]string{hostnameAnnotationKey: "foo.baz"},
hostnames: []string{"lb.com"},
},
expected: []*endpoint.Endpoint{

View File

@ -49,7 +49,6 @@ const (
// The annotation used to determine the source of hostnames for ingresses
ingressHostnameSourceKey = "external-dns.alpha.kubernetes.io/ingress-hostname-source"
// The value of the controller annotation so that we feel responsible
// The value of the controller annotation so that we feel responsible
controllerAnnotationValue = "dns-controller"
// The annotation used for defining the desired hostname
internalHostnameAnnotationKey = "external-dns.alpha.kubernetes.io/internal-hostname"