Skip to content

Commit fdbd80d

Browse files
authored
fix: use platform-admin group instead of team-admin (#1762)
1 parent 938ac7d commit fdbd80d

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

charts/team-ns/templates/argocd/argocd-project.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ spec:
5151
# kind: StatefulSet
5252
roles:
5353
{{- if $v.otomi.isMultitenant }}
54-
# we create a scoped team-admin role since we are only allowed access to team-* projects as team-admin in multitenant setup
55-
- name: team-admin
54+
# we create a scoped platform-admin role since we are only allowed access to team-* projects as platform-admin in multitenant setup
55+
- name: platform-admin
5656
description: Team member privileges to team-{{ $v.teamId }}
5757
policies:
58-
- p, proj:team-{{ $v.teamId }}:team-admin, *, *, team-{{ $v.teamId }}/*, allow
58+
- p, proj:team-{{ $v.teamId }}:platform-admin, *, *, team-{{ $v.teamId }}/*, allow
5959
groups:
60-
- team-admin
60+
- platform-admin
6161
- team-{{ $v.teamId }}
6262
{{- end }}
6363
- name: team-member

charts/team-ns/templates/istio-virtualservices.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ spec:
333333
{{- if not $s.isShared }}
334334
when:
335335
- key: request.auth.claims[groups]
336-
values: [{{ if not (eq $v.teamId "admin") }}team-{{ $v.teamId }},{{ end }}team-admin,admin]
336+
values: [{{ if not (eq $v.teamId "admin") }}team-{{ $v.teamId }},{{ end }}platform-admin,admin]
337337
{{- end }}
338338
to:
339339
- operation:

helmfile.d/helmfile-60.teams.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ releases:
7979
fullnameOverride: {{ $teamId }}-po-grafana
8080
grafana.ini:
8181
"auth.generic_oauth":
82-
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin' || contains(groups[*], 'team-{{ $teamId }}') && 'Editor'{{ if not ($team | get "managedMonitoring.private" false) }} || 'Viewer'{{- end }}
82+
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'platform-admin') && 'Admin' || contains(groups[*], 'team-{{ $teamId }}') && 'Editor'{{ if not ($team | get "managedMonitoring.private" false) }} || 'Viewer'{{- end }}
8383
server:
8484
root_url: https://grafana-{{ $teamId }}.{{ $domain }}
8585
sidecar:

helmfile.d/snippets/grafana.gotmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
auth_url: {{ printf "%s/protocol/openid-connect/auth" .keycloakBase }}
1212
token_url: {{ printf "%s/protocol/openid-connect/token" .keycloakBase }}
1313
api_url: {{ printf "%s/protocol/openid-connect/userinfo" .keycloakBase }}
14-
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin'
14+
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'platform-admin') && 'Admin'
1515
role_attribute_strict: true
1616
log:
1717
level: error

values/argocd/argocd.gotmpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,11 @@ configs:
139139
g, image-updater, role:image-updater
140140
# admin
141141
g, admin, role:admin
142+
g, platform-admin, role:admin
142143
{{- if $v.otomi.isMultitenant }}
143144
policy.default: ''
144145
{{- else }}
145-
# not multitenant, make team-admin admin and keep global read-only
146-
g, team-admin, role:admin
146+
# not multitenant, make platform-admin admin and keep global read-only
147+
g, platform-admin, role:admin
147148
policy.default: role:readonly
148149
{{- end }}

0 commit comments

Comments
 (0)