diff --git a/controllers/tenant_controller.go b/controllers/tenant_controller.go index 3cec08b..4de5a49 100644 --- a/controllers/tenant_controller.go +++ b/controllers/tenant_controller.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "slices" "strings" "text/template" @@ -611,6 +612,7 @@ func (r *TenantReconciler) updateConfigMap(ctx context.Context, controllerName s namespaces = append(namespaces, ns.Name) } } + slices.Sort(namespaces) op, err := ctrl.CreateOrUpdate(ctx, r.client, cm, func() error { cm.Labels = map[string]string{ @@ -665,6 +667,7 @@ func (r *TenantReconciler) updateAllTenantNamespacesConfigMap(ctx context.Contex allNamespaces = append(allNamespaces, ns.Name) } } + slices.Sort(allNamespaces) op, err := ctrl.CreateOrUpdate(ctx, r.client, cm, func() error { cm.Labels = map[string]string{