Skip to content
Snippets Groups Projects
Commit 957fcaaa authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'ozg-3961 use ozgoperator' (#70) from ozg-3961-use-ozgoperator into master

parents 2ae466ba 064ad566
Branches
Tags
No related merge requests found
Showing
with 29 additions and 61 deletions
......@@ -83,7 +83,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "app.generateKeycloakUserSecretName" . }}
key: username
key: name
optional: false
{{- end }}
- name: QUARKUS_MONGODB_DATABASE
......
{{ if .Values.sso.api_user }}
---
apiVersion: api.kop-stack.de/v1
kind: KopKeycloakUser
apiVersion: operator.ozgcloud.de/v1
kind: OzgKeycloakUser
metadata:
name: {{ include "app.generateKeycloakUserRessourceName" . }}
namespace: {{ include "app.namespace" . }}
spec:
keep_after_delete: {{ .Values.sso.api_user.keep_after_delete | default false }}
keycloak_realm: {{ include "app.ssoRealm" . }}
kop_sso_url: {{ include "app.ssoServerUrl" . }}
keycloak_user:
username: {{ .Values.sso.api_user.name | lower }}
first_name: {{ .Values.sso.api_user.first_name | default "" }}
......
{{- if .Values.sso.api_users }}
{{- if (.Values.sso).api_user }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
......@@ -8,9 +8,7 @@ rules:
- apiGroups:
- "*"
resourceNames:
{{ range $user := .Values.sso.api_users }}
- {{ include "app.replaceAllNonAlphanumeric" $user.name }}-credentials
{{ end }}
- {{ include "app.replaceAllNonAlphanumeric" .Values.sso.api_user.name }}-credentials
resources:
- secrets
verbs:
......
{{- if .Values.sso.api_users }}
{{- if (.Values.sso).api_user }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
......
{{- if .Values.sso.api_users }}
{{- if (.Values.sso).api_user }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
......
{{- if .Values.sso.api_users }}
{{- if (.Values.sso).api_user }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
......
......@@ -137,7 +137,7 @@ tests:
valueFrom:
secretKeyRef:
name: usermanagerapiuser-credentials
key: username
key: name
optional: false
- contains:
path: spec.template.spec.containers[0].env
......
......@@ -36,9 +36,9 @@ tests:
name: testapiuser
asserts:
- isAPIVersion:
of: api.kop-stack.de/v1
of: operator.ozgcloud.de/v1
- isKind:
of: KopKeycloakUser
of: OzgKeycloakUser
- it: should have metadata
set:
sso:
......@@ -65,12 +65,6 @@ tests:
- equal:
path: spec.keep_after_delete
value: false
- equal:
path: spec.keycloak_realm
value: by-helm-test
- equal:
path: spec.kop_sso_url
value: https://sso.test.by.ozg-cloud.de
- equal:
path: spec.keycloak_user.first_name
values: ""
......@@ -125,9 +119,6 @@ tests:
path: spec.keycloak_user.realm_roles
- isNull:
path: spec.keycloak_user.client_roles
- equal:
path: spec.kop_sso_url
value: https://sso.test.by.ozg-cloud.de
- it: should have Keycloak User with client role
set:
......@@ -171,9 +162,6 @@ tests:
content:
name: alfa
role: VERWALTUNG_USER
- equal:
path: spec.kop_sso_url
value: https://sso.test.by.ozg-cloud.de
- it: should have Keycloak User with realm role
set:
......@@ -215,9 +203,6 @@ tests:
path: spec.keycloak_user.realm_roles
content:
offline_access
- equal:
path: spec.kop_sso_url
value: https://sso.test.by.ozg-cloud.de
- it: should have Keycloak User with group
set:
......@@ -259,9 +244,6 @@ tests:
path: spec.keycloak_user.groups
content:
Bauamt
- equal:
path: spec.kop_sso_url
value: https://sso.test.by.ozg-cloud.de
- it: should have lowercase username
set:
......@@ -280,12 +262,6 @@ tests:
- equal:
path: spec.keep_after_delete
value: false
- equal:
path: spec.keycloak_realm
value: by-helm-test
- equal:
path: spec.kop_sso_url
value: https://sso.test.by.ozg-cloud.de
- equal:
path: spec.keycloak_user.first_name
values: ""
......
......@@ -8,7 +8,7 @@ tests:
- it: should contain header data
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......@@ -19,7 +19,7 @@ tests:
- it: should have metadata
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......@@ -32,7 +32,7 @@ tests:
- it: should have subjects values
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......@@ -45,7 +45,7 @@ tests:
- it: should have roleRef values
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......
......@@ -8,8 +8,8 @@ tests:
- it: should contain header data
set:
sso:
api_users:
- name: apiuser
api_user:
name: apiuser
asserts:
- isAPIVersion:
of: rbac.authorization.k8s.io/v1
......@@ -18,8 +18,8 @@ tests:
- it: should have metadata
set:
sso:
api_users:
- name: apiuser
api_user:
name: apiuser
asserts:
- equal:
path: metadata.name
......@@ -30,10 +30,8 @@ tests:
- it: should have subjects values
set:
sso:
api_users:
- name: apiuser
- name: _with_underscore_
- name: .with.dot.
api_user:
name: _with_underscore_and.with.dot.
asserts:
- contains:
path: rules
......@@ -41,9 +39,7 @@ tests:
apiGroups:
- "*"
resourceNames:
- apiuser-credentials
- withunderscore-credentials
- withdot-credentials
- withunderscoreandwithdot-credentials
resources:
- secrets
verbs:
......
......@@ -8,7 +8,7 @@ tests:
- it: should contain header data
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......@@ -19,7 +19,7 @@ tests:
- it: should have metadata
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......@@ -32,7 +32,7 @@ tests:
- it: should have subjects values
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......@@ -45,7 +45,7 @@ tests:
- it: should have roleRef values
set:
sso:
api_users:
api_user:
- name: apiuser
operatorNamespace: test-operator-namespace
asserts:
......
......@@ -8,7 +8,7 @@ tests:
- it: should contain header data
set:
sso:
api_users:
api_user:
- name: apiuser
asserts:
- isAPIVersion:
......@@ -18,7 +18,7 @@ tests:
- it: should have metadata
set:
sso:
api_users:
api_user:
- name: apiuser
asserts:
- equal:
......@@ -30,7 +30,7 @@ tests:
- it: should have subjects values
set:
sso:
api_users:
api_user:
- name: apiuser
asserts:
- contains:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment