Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use platform-admin group instead of team-admin #1762

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions charts/team-ns/templates/argocd/argocd-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
# kind: StatefulSet
roles:
{{- if $v.otomi.isMultitenant }}
# we create a scoped team-admin role since we are only allowed access to team-* projects as team-admin in multitenant setup
- name: team-admin
# we create a scoped platform-admin role since we are only allowed access to team-* projects as platform-admin in multitenant setup
- name: platform-admin
description: Team member privileges to team-{{ $v.teamId }}
policies:
- p, proj:team-{{ $v.teamId }}:team-admin, *, *, team-{{ $v.teamId }}/*, allow
- p, proj:team-{{ $v.teamId }}:platform-admin, *, *, team-{{ $v.teamId }}/*, allow
groups:
- team-admin
- platform-admin
- team-{{ $v.teamId }}
{{- end }}
- name: team-member
Expand Down
2 changes: 1 addition & 1 deletion charts/team-ns/templates/istio-virtualservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ spec:
{{- if not $s.isShared }}
when:
- key: request.auth.claims[groups]
values: [{{ if not (eq $v.teamId "admin") }}team-{{ $v.teamId }},{{ end }}team-admin,admin]
values: [{{ if not (eq $v.teamId "admin") }}team-{{ $v.teamId }},{{ end }}platform-admin,admin]
{{- end }}
to:
- operation:
Expand Down
2 changes: 1 addition & 1 deletion helmfile.d/helmfile-60.teams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ releases:
fullnameOverride: {{ $teamId }}-po-grafana
grafana.ini:
"auth.generic_oauth":
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 }}
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 }}
server:
root_url: https://grafana-{{ $teamId }}.{{ $domain }}
sidecar:
Expand Down
2 changes: 1 addition & 1 deletion helmfile.d/snippets/grafana.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
auth_url: {{ printf "%s/protocol/openid-connect/auth" .keycloakBase }}
token_url: {{ printf "%s/protocol/openid-connect/token" .keycloakBase }}
api_url: {{ printf "%s/protocol/openid-connect/userinfo" .keycloakBase }}
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin'
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'platform-admin') && 'Admin'
role_attribute_strict: true
log:
level: error
Expand Down
5 changes: 3 additions & 2 deletions values/argocd/argocd.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ configs:
g, image-updater, role:image-updater
# admin
g, admin, role:admin
g, platform-admin, role:admin
{{- if $v.otomi.isMultitenant }}
policy.default: ''
{{- else }}
# not multitenant, make team-admin admin and keep global read-only
g, team-admin, role:admin
# not multitenant, make platform-admin admin and keep global read-only
g, platform-admin, role:admin
policy.default: role:readonly
{{- end }}