diff --git a/pkg/reconciler/labeler/accessors.go b/pkg/reconciler/labeler/accessors.go index 688ababcda87..36782ca84711 100644 --- a/pkg/reconciler/labeler/accessors.go +++ b/pkg/reconciler/labeler/accessors.go @@ -129,9 +129,9 @@ func updateRouteAnnotation(acc kmeta.Accessor, routeName string, diffAnn map[str return } valSet.Delete(routeName) - sorted := valSet.UnsortedList() - sort.Strings(sorted) - diffAnn[serving.RoutesAnnotationKey] = strings.Join(sorted, ",") + routeNames := valSet.UnsortedList() + sort.Strings(routeNames) + diffAnn[serving.RoutesAnnotationKey] = strings.Join(routeNames, ",") case !has && !remove: if len(valSet) == 0 { @@ -139,9 +139,9 @@ func updateRouteAnnotation(acc kmeta.Accessor, routeName string, diffAnn map[str return } valSet.Insert(routeName) - sorted := valSet.UnsortedList() - sort.Strings(sorted) - diffAnn[serving.RoutesAnnotationKey] = strings.Join(sorted, ",") + routeNames := valSet.UnsortedList() + sort.Strings(routeNames) + diffAnn[serving.RoutesAnnotationKey] = strings.Join(routeNames, ",") } } diff --git a/pkg/reconciler/service/resources/configuration.go b/pkg/reconciler/service/resources/configuration.go index f04662cb9b6a..6cede2877237 100644 --- a/pkg/reconciler/service/resources/configuration.go +++ b/pkg/reconciler/service/resources/configuration.go @@ -49,9 +49,9 @@ func MakeConfigurationFromExisting(service *v1.Service, existing *v1.Configurati routeName := names.Route(service) set := labeler.GetListAnnValue(existing.Annotations, serving.RoutesAnnotationKey) set.Insert(routeName) - sorted := set.UnsortedList() - sort.Strings(sorted) - anns[serving.RoutesAnnotationKey] = strings.Join(sorted, ",") + routeNames := set.UnsortedList() + sort.Strings(routeNames) + anns[serving.RoutesAnnotationKey] = strings.Join(routeNames, ",") return &v1.Configuration{ ObjectMeta: metav1.ObjectMeta{