From 187a31737f9340903bc6f88909c818abbd89c0ab Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Wed, 31 Jul 2024 15:50:47 +0200 Subject: [PATCH] Sort cluster names in permissions to remove unnecessary updates (#302) --- controllers/tenant/role.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/tenant/role.go b/controllers/tenant/role.go index 9168b636..7c873d0f 100644 --- a/controllers/tenant/role.go +++ b/controllers/tenant/role.go @@ -2,6 +2,7 @@ package tenant import ( "fmt" + "slices" "github.com/projectsyn/lieutenant-operator/api/v1alpha1" synv1alpha1 "github.com/projectsyn/lieutenant-operator/api/v1alpha1" @@ -29,6 +30,7 @@ func reconcileRole(obj pipeline.Object, data *pipeline.Context) pipeline.Result for _, c := range cls.Items { clusterNames = append(clusterNames, c.Name) } + slices.Sort(clusterNames) role := rbacv1.Role{ ObjectMeta: metav1.ObjectMeta{