@@ -188,10 +188,9 @@ func (sc *ingressSource) endpointsFromTemplate(ing *networkv1.Ingress) ([]*endpo
188188 return nil , err
189189 }
190190
191- ttl , err := getTTLFromAnnotations (ing .Annotations )
192- if err != nil {
193- log .Warn (err )
194- }
191+ resource := fmt .Sprintf ("ingress/%s/%s" , ing .Namespace , ing .Name )
192+
193+ ttl := getTTLFromAnnotations (ing .Annotations , resource )
195194
196195 targets := getTargetsFromTargetAnnotation (ing .Annotations )
197196 if len (targets ) == 0 {
@@ -200,8 +199,6 @@ func (sc *ingressSource) endpointsFromTemplate(ing *networkv1.Ingress) ([]*endpo
200199
201200 providerSpecific , setIdentifier := getProviderSpecificAnnotations (ing .Annotations )
202201
203- resource := fmt .Sprintf ("ingress/%s/%s" , ing .Namespace , ing .Name )
204-
205202 var endpoints []* endpoint.Endpoint
206203 for _ , hostname := range hostnames {
207204 endpoints = append (endpoints , endpointsForHostname (hostname , targets , ttl , providerSpecific , setIdentifier , resource )... )
@@ -289,10 +286,9 @@ func (sc *ingressSource) setDualstackLabel(ingress *networkv1.Ingress, endpoints
289286
290287// endpointsFromIngress extracts the endpoints from ingress object
291288func endpointsFromIngress (ing * networkv1.Ingress , ignoreHostnameAnnotation bool , ignoreIngressTLSSpec bool , ignoreIngressRulesSpec bool ) []* endpoint.Endpoint {
292- ttl , err := getTTLFromAnnotations (ing .Annotations )
293- if err != nil {
294- log .Warn (err )
295- }
289+ resource := fmt .Sprintf ("ingress/%s/%s" , ing .Namespace , ing .Name )
290+
291+ ttl := getTTLFromAnnotations (ing .Annotations , resource )
296292
297293 targets := getTargetsFromTargetAnnotation (ing .Annotations )
298294
@@ -302,8 +298,6 @@ func endpointsFromIngress(ing *networkv1.Ingress, ignoreHostnameAnnotation bool,
302298
303299 providerSpecific , setIdentifier := getProviderSpecificAnnotations (ing .Annotations )
304300
305- resource := fmt .Sprintf ("ingress/%s/%s" , ing .Namespace , ing .Name )
306-
307301 // Gather endpoints defined on hosts sections of the ingress
308302 var definedHostsEndpoints []* endpoint.Endpoint
309303 // Skip endpoints if we do not want entries from Rules section
0 commit comments