From 53e12c3166abe19639083375605bfbd542d0349e Mon Sep 17 00:00:00 2001
From: Felix Reichenbach <felix.reichenbach@mgm-tp.com>
Date: Mon, 24 Mar 2025 08:45:21 +0100
Subject: [PATCH 1/2] OZG-7573 add grpc port to service

---
 src/main/helm/templates/service.yaml |  3 +++
 src/test/helm/service_test.yaml      | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/src/main/helm/templates/service.yaml b/src/main/helm/templates/service.yaml
index 78dc3c5b8..80b44f3d9 100644
--- a/src/main/helm/templates/service.yaml
+++ b/src/main/helm/templates/service.yaml
@@ -32,6 +32,9 @@ metadata:
     component: eingang-adapter-service
 spec:
   ports:
+    - name: grpc-9090
+      port: 9090
+      protocol: TCP
     - name: http
       port: 8080
       protocol: TCP
diff --git a/src/test/helm/service_test.yaml b/src/test/helm/service_test.yaml
index 16119984f..0f7db44d7 100644
--- a/src/test/helm/service_test.yaml
+++ b/src/test/helm/service_test.yaml
@@ -49,6 +49,16 @@ tests:
       - equal:
           path: spec.type
           value: ClusterIP
+  - it: ports should contain the grpc port
+    asserts:
+      - contains:
+          path: spec.ports
+          content:
+            name: grpc-9090
+            port: 9090
+            protocol: TCP
+          count: 1
+          any: true
   - it: ports should contain the 8080 default http port
     asserts:
       - contains:
-- 
GitLab


From a4ec1a581f27c2bdeed19d4468f33c040ef9951b Mon Sep 17 00:00:00 2001
From: Felix Reichenbach <felix.reichenbach@mgm-tp.com>
Date: Mon, 24 Mar 2025 09:00:57 +0100
Subject: [PATCH 2/2] OZG-7573 set grpc port conditional

---
 src/main/helm/templates/service.yaml |  2 ++
 src/test/helm/service_test.yaml      | 18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/main/helm/templates/service.yaml b/src/main/helm/templates/service.yaml
index 80b44f3d9..a85dbf18e 100644
--- a/src/main/helm/templates/service.yaml
+++ b/src/main/helm/templates/service.yaml
@@ -32,9 +32,11 @@ metadata:
     component: eingang-adapter-service
 spec:
   ports:
+  {{- if (.Values.forwarding).enabled }}
     - name: grpc-9090
       port: 9090
       protocol: TCP
+  {{- end }}
     - name: http
       port: 8080
       protocol: TCP
diff --git a/src/test/helm/service_test.yaml b/src/test/helm/service_test.yaml
index 0f7db44d7..41a970a9f 100644
--- a/src/test/helm/service_test.yaml
+++ b/src/test/helm/service_test.yaml
@@ -49,7 +49,10 @@ tests:
       - equal:
           path: spec.type
           value: ClusterIP
-  - it: ports should contain the grpc port
+  - it: should contain the grpc port in the ports list if forwarding enabled
+    set:
+      forwarding:
+        enabled: true
     asserts:
       - contains:
           path: spec.ports
@@ -59,6 +62,19 @@ tests:
             protocol: TCP
           count: 1
           any: true
+  - it: should not contain the grpc port in the ports list if forwarding disabled
+    set:
+      forwarding:
+        enabled: false
+    asserts:
+      - notContains:
+          path: spec.ports
+          content:
+            name: grpc-9090
+            port: 9090
+            protocol: TCP
+          count: 1
+          any: true
   - it: ports should contain the 8080 default http port
     asserts:
       - contains:
-- 
GitLab