From 746ee3c77a53e4adeec9e4a33389d0d3f3a87bf3 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Mon, 20 Nov 2023 14:27:56 +0100
Subject: [PATCH] OZG-4183 OZG-4584 rename usermanager to ozgcloud

---
 README.md                                          |  2 +-
 src/main/helm/templates/deployment.yaml            | 14 +++++++-------
 src/test/helm/deployment-keycloak-values-test.yaml | 14 +++++++-------
 src/test/helm/deployment-url-value-test.yaml       |  2 +-
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index 4dd9a6aa..f2ef57cf 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ This properties must be configured to run the application
 | ozgcloud.keycloak.api.realm                        | realm-name                                         | none                   | yes | The name of the realm                                          |
 | ozgcloud.keycloak.api.organisations-einheit-id-key | organisationseinheitId                             | organisationseinheitId | no | The key where the organisationsEinheitId of the group is saved |
 | ozgcloud.keycloak.api.ldap-id-key                  | LDAP_ID                                            | LDAP_ID                | no | The key to get the keycloak user id from                       |
-| ozgcloud.usermanager.url                           | http://localhost:8080                              | none                   | yes | The external root url of the usermanager                       |
+| ozgcloud.user-manager.url                          | http://localhost:8080                              | none                   | yes | The external root url of the usermanager                       |
 | keycloak.url                                       | https://sso.service                                | none                   | yes | The root url of the keycloak service                           |
 
 ## Running the application in dev mode
diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml
index b97170fb..2f65ea6f 100644
--- a/src/main/helm/templates/deployment.yaml
+++ b/src/main/helm/templates/deployment.yaml
@@ -64,22 +64,22 @@ spec:
               key: connectionString.standard
               optional: false
         {{- if not (.Values.sso).api_user }}
-        - name: USERMANAGER_KEYCLOAK_API_PASSWORD
+        - name: OZGCLOUD_KEYCLOAK_API_PASSWORD
           valueFrom:
             secretKeyRef:
               name: user-manager-api-password
               key: password
               optional: false
-        - name: USERMANAGER_KEYCLOAK_API_USER
+        - name: OZGCLOUD_KEYCLOAK_API_USER
           value: {{ .Values.ozgcloud.keycloak.api.user }}
         {{- else }}
-        - name: USERMANAGER_KEYCLOAK_API_PASSWORD
+        - name: OZGCLOUD_KEYCLOAK_API_PASSWORD
           valueFrom:
             secretKeyRef:
               name: {{ include "app.generateKeycloakUserSecretName" . }}
               key: password
               optional: false
-        - name: USERMANAGER_KEYCLOAK_API_USER
+        - name: OZGCLOUD_KEYCLOAK_API_USER
           valueFrom:
             secretKeyRef:
               name: {{ include "app.generateKeycloakUserSecretName" . }}
@@ -88,15 +88,15 @@ spec:
         {{- end }}
         - name: QUARKUS_MONGODB_DATABASE
           value: {{ include "app.databaseName" . }}
-        - name: USERMANAGER_KEYCLOAK_API_REALM
+        - name: OZGCLOUD_KEYCLOAK_API_REALM
           value: {{ include "app.ssoRealm" . }}
-        - name: USERMANAGER_KEYCLOAK_API_CLIENT
+        - name: OZGCLOUD_KEYCLOAK_API_CLIENT
           value: {{ include "app.ssoClientName" . }}
         - name: QUARKUS_OIDC_AUTH_SERVER_URL
           value: {{ include "app.ssoServerUrl" . }}/realms/{{ include "app.ssoRealm" . }}
         - name: KEYCLOAK_URL
           value: {{ include "app.ssoServerUrl" . }}
-        - name: USERMANAGER_USER_MANAGER_URL
+        - name: OZGCLOUD_USER_MANAGER_URL
           value: {{ include "app.baseUrl" . }}
         {{- if ((.Values.ozgcloud).usersync).period }}
         - name: OZGCLOUD_USERSYNC_PERIOD
diff --git a/src/test/helm/deployment-keycloak-values-test.yaml b/src/test/helm/deployment-keycloak-values-test.yaml
index 684626f3..a59be04d 100644
--- a/src/test/helm/deployment-keycloak-values-test.yaml
+++ b/src/test/helm/deployment-keycloak-values-test.yaml
@@ -36,12 +36,12 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].env
           content:
-            name: USERMANAGER_KEYCLOAK_API_USER
+            name: OZGCLOUD_KEYCLOAK_API_USER
             value: userManagerApiUser
       - contains:
           path: spec.template.spec.containers[0].env
           content: 
-            name: USERMANAGER_KEYCLOAK_API_PASSWORD
+            name: OZGCLOUD_KEYCLOAK_API_PASSWORD
             valueFrom:
               secretKeyRef:
                 name: user-manager-api-password
@@ -50,7 +50,7 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].env
           content: 
-            name: USERMANAGER_KEYCLOAK_API_REALM
+            name: OZGCLOUD_KEYCLOAK_API_REALM
             value: sh-helm-test
       - contains:
           path: spec.template.spec.containers[0].env
@@ -65,7 +65,7 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].env
           content: 
-            name: USERMANAGER_KEYCLOAK_API_CLIENT
+            name: OZGCLOUD_KEYCLOAK_API_CLIENT
             value: alfa
 
   - it: should set keycloak client name
@@ -79,7 +79,7 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].env
           content: 
-            name: USERMANAGER_KEYCLOAK_API_CLIENT
+            name: OZGCLOUD_KEYCLOAK_API_CLIENT
             value: alfa
 
   - it: sso.serverurl with https
@@ -128,7 +128,7 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].env
           content:
-            name: USERMANAGER_KEYCLOAK_API_USER
+            name: OZGCLOUD_KEYCLOAK_API_USER
             valueFrom:
               secretKeyRef:
                 name: usermanagerapiuser-credentials
@@ -137,7 +137,7 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].env
           content: 
-            name: USERMANAGER_KEYCLOAK_API_PASSWORD
+            name: OZGCLOUD_KEYCLOAK_API_PASSWORD
             valueFrom:
               secretKeyRef:
                 name: usermanagerapiuser-credentials
diff --git a/src/test/helm/deployment-url-value-test.yaml b/src/test/helm/deployment-url-value-test.yaml
index f0a102fe..02fd1681 100644
--- a/src/test/helm/deployment-url-value-test.yaml
+++ b/src/test/helm/deployment-url-value-test.yaml
@@ -36,5 +36,5 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].env
           content:
-            name: USERMANAGER_USER_MANAGER_URL
+            name: OZGCLOUD_USER_MANAGER_URL
             value: https://helm-user-manager.test.sh.ozg-cloud.de
\ No newline at end of file
-- 
GitLab