From aea52b8fa7d8d6c73e15a426db53aae78042ab2b Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Tue, 18 Jun 2024 16:37:22 +0200
Subject: [PATCH] ozg-5634 disable ingress

---
 src/main/helm/templates/ingress.yaml                | 4 +++-
 src/test/helm/ingress_defaults_annotation_test.yaml | 8 ++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/main/helm/templates/ingress.yaml b/src/main/helm/templates/ingress.yaml
index b82457c910..1b180c262d 100644
--- a/src/main/helm/templates/ingress.yaml
+++ b/src/main/helm/templates/ingress.yaml
@@ -22,6 +22,7 @@
 # unter der Lizenz sind dem Lizenztext zu entnehmen.
 #
 
+{{- if not (.Values.ingress).disabled }}
 apiVersion: networking.k8s.io/v1
 kind: Ingress
 metadata:
@@ -62,4 +63,5 @@ spec:
       {{- else }}
       secretName: {{ .Values.ozgcloud.bezeichner }}-{{ .Release.Name }}-tls
       {{- end }}
-      {{- end }}
\ No newline at end of file
+      {{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/src/test/helm/ingress_defaults_annotation_test.yaml b/src/test/helm/ingress_defaults_annotation_test.yaml
index 069e38601b..1416cca701 100644
--- a/src/test/helm/ingress_defaults_annotation_test.yaml
+++ b/src/test/helm/ingress_defaults_annotation_test.yaml
@@ -51,3 +51,11 @@ tests:
       - equal:
           path: spec.tls[0].secretName
           value: helm-alfa-tls
+
+  - it: should disable ingress
+    set:
+      ingress:
+        disabled: true
+    asserts:
+      - hasDocuments:
+          count: 0
\ No newline at end of file
-- 
GitLab