@@ -300,8 +300,10 @@ func (sc *routeGroupSource) endpointsFromTemplate(rg *routeGroup) ([]*endpoint.E
300
300
301
301
hostnames := buf .String ()
302
302
303
+ resource := fmt .Sprintf ("routegroup/%s/%s" , rg .Metadata .Namespace , rg .Metadata .Name )
304
+
303
305
// error handled in endpointsFromRouteGroup(), otherwise duplicate log
304
- ttl , _ := getTTLFromAnnotations (rg .Metadata .Annotations )
306
+ ttl := getTTLFromAnnotations (rg .Metadata .Annotations , resource )
305
307
306
308
targets := getTargetsFromTargetAnnotation (rg .Metadata .Annotations )
307
309
@@ -311,8 +313,6 @@ func (sc *routeGroupSource) endpointsFromTemplate(rg *routeGroup) ([]*endpoint.E
311
313
312
314
providerSpecific , setIdentifier := getProviderSpecificAnnotations (rg .Metadata .Annotations )
313
315
314
- resource := fmt .Sprintf ("routegroup/%s/%s" , rg .Metadata .Namespace , rg .Metadata .Name )
315
-
316
316
var endpoints []* endpoint.Endpoint
317
317
// splits the FQDN template and removes the trailing periods
318
318
hostnameList := strings .Split (strings .Replace (hostnames , " " , "" , - 1 ), "," )
@@ -336,10 +336,10 @@ func (sc *routeGroupSource) setRouteGroupDualstackLabel(rg *routeGroup, eps []*e
336
336
// annotation logic ported from source/ingress.go without Spec.TLS part, because it'S not supported in RouteGroup
337
337
func (sc * routeGroupSource ) endpointsFromRouteGroup (rg * routeGroup ) []* endpoint.Endpoint {
338
338
endpoints := []* endpoint.Endpoint {}
339
- ttl , err := getTTLFromAnnotations ( rg . Metadata . Annotations )
340
- if err != nil {
341
- log . Warnf ( "Failed to get TTL from annotation: %v" , err )
342
- }
339
+
340
+ resource := fmt . Sprintf ( "routegroup/%s/%s" , rg . Metadata . Namespace , rg . Metadata . Name )
341
+
342
+ ttl := getTTLFromAnnotations ( rg . Metadata . Annotations , resource )
343
343
344
344
targets := getTargetsFromTargetAnnotation (rg .Metadata .Annotations )
345
345
if len (targets ) == 0 {
@@ -355,8 +355,6 @@ func (sc *routeGroupSource) endpointsFromRouteGroup(rg *routeGroup) []*endpoint.
355
355
356
356
providerSpecific , setIdentifier := getProviderSpecificAnnotations (rg .Metadata .Annotations )
357
357
358
- resource := fmt .Sprintf ("routegroup/%s/%s" , rg .Metadata .Namespace , rg .Metadata .Name )
359
-
360
358
for _ , src := range rg .Spec .Hosts {
361
359
if src == "" {
362
360
continue
0 commit comments