Skip to content

Commit 037ee46

Browse files
committed
Also sort permissions
1 parent f5e0f8f commit 037ee46

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/policies/gcp.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package policies
22

33
import (
4+
"slices"
45
"strings"
56

67
cco "github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1"
@@ -53,6 +54,7 @@ func CredentialsRequestToWifServiceAccount(credReq *cco.CredentialsRequest) (*Se
5354
if len(gcpSpec.Permissions) > 0 {
5455
roleId := strings.ReplaceAll(credReq.Name, "-", "_")
5556
roleId = roleId[:min(64, len(roleId))]
57+
slices.Sort(gcpSpec.Permissions)
5658
sa.Roles = append(sa.Roles, Role{
5759
Id: roleId,
5860
Kind: "Role",

0 commit comments

Comments
 (0)