From a0236478ba6fc3fcc6a3ec271b17e0f5ee1e87ee Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Wed, 10 Apr 2024 00:13:56 +0200
Subject: [PATCH] fix kustomzie build

---
 .gitlab-ci.yml              |  3 ++-
 deploy/base/deployment.yaml | 35 ++++++++++++++++-------------------
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3e7cee44..d6f54b83 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -83,6 +83,7 @@ deploy review:
   script:
     - cd deploy/overlays/review
     - kustomize edit set image registry.edugit.org/teckids/team-pr/teckids.org:$CI_COMMIT_REF_NAME@$(cat ../../../DIGESTFILE)
+    - kustomize edit set nameprefix $CI_COMMIT_REF_SLUG
     - kustomize build | sed s/__REVIEW_NAME__/$CI_COMMIT_REF_SLUG/g > output.yaml
     - kubectl --kubeconfig=/tmp/kubeconfig apply -f output.yaml
 
@@ -95,7 +96,7 @@ delete review:
   before_script:
     - echo $KUBECONFIG | base64 -d > /tmp/kubeconfig
     - cd deploy/overlays/review
-    - kustomize build | envsubst > output.yaml
+    - kustomize build | sed s/__REVIEW_NAME__/$CI_COMMIT_REF_SLUG/g > output.yaml
   script:
     - kubectl --kubeconfig=/tmp/kubeconfig delete -f output.yaml
   when: manual
diff --git a/deploy/base/deployment.yaml b/deploy/base/deployment.yaml
index 20fee733..37d1473b 100644
--- a/deploy/base/deployment.yaml
+++ b/deploy/base/deployment.yaml
@@ -19,22 +19,19 @@ spec:
       - name: caddy
         image: registry.edugit.org/teckids/team-pr/teckids.org:IMAGE_TAG
         ports:
-        - containerPort: 80
-          livenessProbe:
-            httpGet:
-              scheme: HTTP
-              port: http
-              path: /
-            timeoutSeconds: 10
-            initialDelaySeconds: 60
-          name: adressbuch
-          ports:
-            - containerPort: 80
-              name: http
-          readinessProbe:
-            httpGet:
-              scheme: HTTP
-              port: http
-              path: /
-            timeoutSeconds: 10
-            initialDelaySeconds: 120
+          - containerPort: 80
+            name: http
+        livenessProbe:
+          httpGet:
+            scheme: HTTP
+            port: http
+            path: /
+          timeoutSeconds: 10
+          initialDelaySeconds: 60
+        readinessProbe:
+          httpGet:
+            scheme: HTTP
+            port: http
+            path: /
+          timeoutSeconds: 10
+          initialDelaySeconds: 120
-- 
GitLab