From b81d83f67095e77ee657f7f7bf7f7c0684a280dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20=20LAURENT?= <francois.laurent@pasteur.fr>
Date: Thu, 23 Jan 2025 14:58:19 +0100
Subject: [PATCH] fix image tag

---
 nyxui/templates/deployment-front.yaml | 2 +-
 nyxui/values.yaml                     | 5 ++---
 values-yaml.gotmpl                    | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/nyxui/templates/deployment-front.yaml b/nyxui/templates/deployment-front.yaml
index 0085804..6205979 100644
--- a/nyxui/templates/deployment-front.yaml
+++ b/nyxui/templates/deployment-front.yaml
@@ -34,7 +34,7 @@ spec:
         - name: {{ .Chart.Name }}
           securityContext:
             {{- toYaml .Values.securityContext | nindent 12 }}
-          image: "{{ .Values.front.image.repository }}:{{ .Values.front.image.tag | default .Chart.AppVersion }}"
+          image: "{{ .Values.front.image.repository }}:{{ .Values.front.image.sha }}"
           imagePullPolicy: {{ .Values.front.image.pullPolicy }}
           ports:
             - name: http
diff --git a/nyxui/values.yaml b/nyxui/values.yaml
index cfb6089..535e575 100644
--- a/nyxui/values.yaml
+++ b/nyxui/values.yaml
@@ -6,10 +6,9 @@ replicaCount: 1
 
 front:
   image:
-    repository: registry-gitlab.pasteur.fr/nyx/nyxui.jl/front
+    repository: registry-gitlab.pasteur.fr/nyx/nyxui/front
+    sha: ""
     pullPolicy: Always
-    # Overrides the image tag whose default is the chart appVersion.
-    tag: ""
   service:
     targetPort: 8080
 
diff --git a/values-yaml.gotmpl b/values-yaml.gotmpl
index df2c516..4d1bb85 100644
--- a/values-yaml.gotmpl
+++ b/values-yaml.gotmpl
@@ -8,8 +8,7 @@ front:
   image:
     repository: {{ requiredEnv "IMAGE_URL" }}
     pullPolicy: {{ requiredEnv "IMAGE_POLICY" }}
-    # Overrides the image tag whose default is the chart appVersion.
-    tag: ""
+    sha: {{ requiredEnv "CI_COMMIT_SHORT_SHA" }}
   service:
     targetPort: {{ requiredEnv "SERVICE_TARGET_PORT" }} 
 
-- 
GitLab