Skip to content

Commit

Permalink
refactor(api/v1beta1/owner_role.go): split cluster role that need to …
Browse files Browse the repository at this point in the history
…be cluster bound

Signed-off-by: Massimiliano Giovagnoli <[email protected]>
  • Loading branch information
maxgio92 committed Aug 13, 2022
1 parent 3cd7bfe commit 5a9c25b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/v1beta1/owner_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ func (in OwnerSpec) GetRoles(tenant Tenant, index int) []string {

roles := []string{"admin", "capsule-namespace-deleter"}

return roles
}

func (in OwnerSpec) GetClusterRoles(tenant Tenant) []string {
if tenant.Spec.GitOpsReady {
roles = append(roles, in.getGitOpsRoles(tenant)...)
return in.getGitOpsRoles(tenant)
}

return roles
return []string{}
}

func (in OwnerSpec) getGitOpsRoles(tenant Tenant) []string {
Expand Down

0 comments on commit 5a9c25b

Please sign in to comment.