@@ -417,21 +417,24 @@ func (sc *serviceSource) endpointsFromTemplate(svc *v1.Service) ([]*endpoint.End
417417func (sc * serviceSource ) endpoints (svc * v1.Service ) []* endpoint.Endpoint {
418418 var endpoints []* endpoint.Endpoint
419419 // Skip endpoints if we do not want entries from annotations
420- if ! sc .ignoreHostnameAnnotation {
421- providerSpecific , setIdentifier := annotations .ProviderSpecificAnnotations (svc .Annotations )
422- var hostnameList []string
423- var internalHostnameList []string
424-
425- hostnameList = annotations .HostnamesFromAnnotations (svc .Annotations )
426- for _ , hostname := range hostnameList {
427- endpoints = append (endpoints , sc .generateEndpoints (svc , hostname , providerSpecific , setIdentifier , false )... )
428- }
420+ if sc .ignoreHostnameAnnotation {
421+ return endpoints
422+ }
429423
430- internalHostnameList = annotations .InternalHostnamesFromAnnotations (svc .Annotations )
431- for _ , hostname := range internalHostnameList {
432- endpoints = append (endpoints , sc .generateEndpoints (svc , hostname , providerSpecific , setIdentifier , true )... )
433- }
424+ providerSpecific , setIdentifier := annotations .ProviderSpecificAnnotations (svc .Annotations )
425+ var hostnameList []string
426+ var internalHostnameList []string
427+
428+ hostnameList = annotations .HostnamesFromAnnotations (svc .Annotations )
429+ for _ , hostname := range hostnameList {
430+ endpoints = append (endpoints , sc .generateEndpoints (svc , hostname , providerSpecific , setIdentifier , false )... )
434431 }
432+
433+ internalHostnameList = annotations .InternalHostnamesFromAnnotations (svc .Annotations )
434+ for _ , hostname := range internalHostnameList {
435+ endpoints = append (endpoints , sc .generateEndpoints (svc , hostname , providerSpecific , setIdentifier , true )... )
436+ }
437+
435438 return endpoints
436439}
437440
0 commit comments