From 987699b7f2980be955b2c61da7aeac2d532a5dde Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Mon, 23 Sep 2024 16:19:20 +0200
Subject: [PATCH] OZG-6514 update deployment env

---
 src/main/helm/templates/deployment.yaml |  6 ++----
 src/test/helm-linter-values.yaml        |  7 +------
 src/test/helm/deployment_env_test.yaml  | 25 +++++++++++++------------
 3 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml
index 8166925..cb1dc50 100644
--- a/src/main/helm/templates/deployment.yaml
+++ b/src/main/helm/templates/deployment.yaml
@@ -63,11 +63,9 @@ spec:
           - name: GRPC_MOCK
             value: "{{ (.Values.grpc).mock | default false }}"
           - name: GRPC_REGISTRATION_SERVER_URL
-            value: "{{ required ".Values.grpc.registration.server.url must be set" (.Values.grpc.registration.server).url }}"
+            value: "{{ required ".Values.grpc.registration.server.url must be set" (((.Values.grpc).registration).server).url }}"
           - name: GRPC_COLLABORATION_SERVER_PORT
-            value: "{{ required ".Values.grpc.collaboration.server.port must be set" (.Values.grpc.collaboration.server).port }}"
-          - name: GRPC_COLLABORATION_ROUTER_PORT
-            value: "{{ required ".Values.grpc.collaboration.router.port must be set" (.Values.grpc.collaboration.router).port }}"
+            value: "9090"
           {{- with include "app.getCustomList" . }}
 {{ . | indent 10 }}
           {{- end }}
diff --git a/src/test/helm-linter-values.yaml b/src/test/helm-linter-values.yaml
index 8c9ed46..06d4fe3 100644
--- a/src/test/helm-linter-values.yaml
+++ b/src/test/helm-linter-values.yaml
@@ -33,11 +33,6 @@ http:
   server:
     port: 8080
 grpc:
-  collaboration:
-    router:
-      port: 50051
-    server:
-      port: 50052
   registration:
     server:
-      url: "zufi.de:9090"
\ No newline at end of file
+      url: "collaboration.de:9090"
\ No newline at end of file
diff --git a/src/test/helm/deployment_env_test.yaml b/src/test/helm/deployment_env_test.yaml
index 3cd5d07..99f00f6 100644
--- a/src/test/helm/deployment_env_test.yaml
+++ b/src/test/helm/deployment_env_test.yaml
@@ -36,7 +36,9 @@ tests:
         - name: test_environment
           value: "B test value"
       grpc:
-        url: "zufi.de:9090"
+        registration:
+          server:
+            url: "collaboration.de:9090"
     asserts:
       - contains:
           path: spec.template.spec.containers[0].env
@@ -54,7 +56,9 @@ tests:
         my_test_environment_name: "A test value"
         test_environment: "B test value"
       grpc:
-        url: "zufi.de:9090"
+        registration:
+          server:
+            url: "collaboration.de:9090"
     asserts:
       - contains:
           path: spec.template.spec.containers[0].env
@@ -70,23 +74,20 @@ tests:
   - it: check envs
     set:       
       grpc:
-        url: "zufi.de:9090"
+        registration:
+          server:
+            url: "collaboration.de:9090"
     asserts:
       - contains:
           path: spec.template.spec.containers[0].env
           content:
             name: GRPC_COLLABORATION_SERVER_PORT
-            value: "50052"
-      - contains:
-          path: spec.template.spec.containers[0].env
-          content:
-            name: GRPC_COLLABORATION_ROUTER_PORT
-            value: "50051"
+            value: "9090"
       - contains:
           path: spec.template.spec.containers[0].env
           content:
             name: GRPC_REGISTRATION_SERVER_URL
-            value: "zufi.de:9090"
+            value: "collaboration.de:9090"
       - contains:
           path: spec.template.spec.containers[0].env
           content:
@@ -97,8 +98,8 @@ tests:
           content:
             name: HTTP_SERVER_PORT
             value: "8082"
-  - it: should fail template if grpc.url not set
+  - it: should fail template if grpc.registration.server.url not set
     set:
     asserts:
       - failedTemplate:
-          errormessage: ".Values.grpc.url must be set"
\ No newline at end of file
+          errormessage: ".Values.grpc.registration.server.url must be set"
-- 
GitLab