Skip to content
Snippets Groups Projects
Commit 4a1bc046 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6867 OZG-6895 Configuration to enable creating secrets

parent 54679175
No related branches found
No related tags found
No related merge requests found
{{- if not (.Values.sso).disableOzgOperator }} {{- if not (.Values.sso).disableOzgOperator }}
{{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_users) }} {{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_user) }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
...@@ -9,7 +9,7 @@ rules: ...@@ -9,7 +9,7 @@ rules:
- apiGroups: - apiGroups:
- "*" - "*"
resourceNames: resourceNames:
{{ range $user := concat (.Values.sso.keycloak_users | default list) (.Values.sso.api_users | default list) }} {{ range $user := concat (.Values.sso.keycloak_users | default list) (empty (.Values.sso).api_user | ternary (list) (list .Values.sso.api_user)) }}
- {{ include "app.nameToIdentifier" $user.name }}-credentials - {{ include "app.nameToIdentifier" $user.name }}-credentials
{{ end }} {{ end }}
resources: resources:
......
{{- if not (.Values.sso).disableOzgOperator }} {{- if not (.Values.sso).disableOzgOperator }}
{{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_users) }} {{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_user) }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
......
{{- if not (.Values.sso).disableOzgOperator }} {{- if not (.Values.sso).disableOzgOperator }}
{{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_users) }} {{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_user) }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
......
{{- if not (.Values.sso).disableOzgOperator }} {{- if not (.Values.sso).disableOzgOperator }}
{{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_users) }} {{- if or ((.Values.sso).keycloak_users) ((.Values.sso).api_user) }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
......
...@@ -62,11 +62,11 @@ tests: ...@@ -62,11 +62,11 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should have subjects values on api_users - it: should have subjects values on api_user
set: set:
sso: sso:
api_users: api_user:
- name: apiUser name: apiUser
operatorNamespace: test-operator-namespace operatorNamespace: test-operator-namespace
asserts: asserts:
- contains: - contains:
...@@ -80,8 +80,8 @@ tests: ...@@ -80,8 +80,8 @@ tests:
set: set:
sso: sso:
disableOzgOperator: true disableOzgOperator: true
api_users: api_user:
- name: apiUser name: apiUser
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
...@@ -55,11 +55,11 @@ tests: ...@@ -55,11 +55,11 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should have subjects values on api_users - it: should have subjects values on api_user
set: set:
sso: sso:
api_users: api_user:
- name: apiUser- name: apiUser
asserts: asserts:
- contains: - contains:
path: rules path: rules
...@@ -78,8 +78,8 @@ tests: ...@@ -78,8 +78,8 @@ tests:
set: set:
sso: sso:
disableOzgOperator: true disableOzgOperator: true
api_users: api_user:
- name: apiUser name: apiUser
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
\ No newline at end of file
...@@ -62,11 +62,11 @@ tests: ...@@ -62,11 +62,11 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should have subjects values on api_users - it: should have subjects values on api_user
set: set:
sso: sso:
api_users: api_user:
- name: apiUsers name: apiUsers
operatorNamespace: test-operator-namespace operatorNamespace: test-operator-namespace
asserts: asserts:
- contains: - contains:
...@@ -80,8 +80,8 @@ tests: ...@@ -80,8 +80,8 @@ tests:
set: set:
sso: sso:
disableOzgOperator: true disableOzgOperator: true
api_users: api_user:
- name: apiUser name: apiUser
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
...@@ -47,11 +47,11 @@ tests: ...@@ -47,11 +47,11 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should have subjects values on api_users - it: should have subjects values on api_user
set: set:
sso: sso:
api_users: api_user:
- name: apiUser name: apiUser
asserts: asserts:
- contains: - contains:
path: rules path: rules
...@@ -67,8 +67,8 @@ tests: ...@@ -67,8 +67,8 @@ tests:
set: set:
sso: sso:
disableOzgOperator: true disableOzgOperator: true
api_users: api_user:
- name: apiUser name: apiUser
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment