Skip to content

Commit

Permalink
Add missing resource in CRD cluster roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien DELACROIX committed Feb 28, 2024
1 parent 904c7d6 commit a4b81eb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/bootstrap/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ func installCRDRole(ctx context.Context, cl client.Client) error {
},
},
}

if role.role == "view" {
crdRole.Rules[0].APIGroups = append(crdRole.Rules[0].APIGroups, "federation.maistra.io")
crdRole.Rules[0].APIGroups = append(crdRole.Rules[0].APIGroups, "telemetry.istio.io")

crdRole.Rules[1].Resources = append(crdRole.Rules[1].Resources, "servicemeshcontrolplanes")
crdRole.Rules[1].Resources = append(crdRole.Rules[1].Resources, "servicemeshmembers")
crdRole.Rules[1].Resources = append(crdRole.Rules[1].Resources, "servicemeshmemberrolls")
}

existingRole := crdRole.DeepCopy()
if err := cl.Get(ctx, client.ObjectKey{Name: crdRole.Name}, existingRole); err == nil {
if !reflect.DeepEqual(existingRole.Rules, crdRole.Rules) {
Expand Down

0 comments on commit a4b81eb

Please sign in to comment.