From 1675997748f0c2d45bae3568f33dc9c9192e6f80 Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Fri, 21 Apr 2023 11:14:39 -0700 Subject: [PATCH] Tornjak global image fix (#228) This pr updates the Tornjak branch to work with the merged global registry configuration support. Signed-off-by: Mariusz Sabath Signed-off-by: kfox1111 --- .../spire-server/templates/statefulset.yaml | 2 +- .../charts/tornjak-frontend/templates/NOTES.txt | 2 +- .../tornjak-frontend/templates/_helpers.tpl | 16 ---------------- .../tornjak-frontend/templates/deployment.yaml | 2 +- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/charts/spire/charts/spire-server/templates/statefulset.yaml b/charts/spire/charts/spire-server/templates/statefulset.yaml index 6e93b91..3a1322b 100644 --- a/charts/spire/charts/spire-server/templates/statefulset.yaml +++ b/charts/spire/charts/spire-server/templates/statefulset.yaml @@ -162,7 +162,7 @@ spec: - name: tornjak securityContext: {{- toYaml .Values.controllerManager.securityContext | nindent 12 }} - image: {{ template "spire-lib.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.tornjak.image) }} + image: {{ template "spire-lib.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.tornjak.image "global" .Values.global) }} imagePullPolicy: {{ .Values.tornjak.image.pullPolicy }} startupProbe: httpGet: diff --git a/charts/spire/charts/tornjak-frontend/templates/NOTES.txt b/charts/spire/charts/tornjak-frontend/templates/NOTES.txt index 50d8fe4..ea06ed1 100644 --- a/charts/spire/charts/tornjak-frontend/templates/NOTES.txt +++ b/charts/spire/charts/tornjak-frontend/templates/NOTES.txt @@ -6,7 +6,7 @@ Your release is named: {{ .Release.Name }} Namespace: {{ include "tornjak-frontend.namespace" . }} Tornjak UI (Frontend) - image: {{ template "tornjak-frontend.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.image) }} + image: {{ template "spire-lib.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.image "global" .Values.global) }} pull policy: {{ .Values.image.pullPolicy }} Configured with Tornjak API (Backend): {{ include "tornjak-frontend.apiURL" . }} diff --git a/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl b/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl index 77f7c12..1ad4567 100644 --- a/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl +++ b/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl @@ -80,22 +80,6 @@ Create the name of the service account to use {{- end }} {{- end }} -{{/* -Create an image name -*/}} -{{- define "tornjak-frontend.image" -}} -{{- if eq (substr 0 7 .image.version) "sha256:" -}} -{{- printf "%s/%s@%s" .image.registry .image.repository .image.version -}} -{{- else if .appVersion -}} -{{- printf "%s/%s:%s" .image.registry .image.repository (default .appVersion .image.version) -}} -{{- else if - .Values.tornjakFrontend.image.version -}} -{{- printf "%s/%s:%s" .Values.tornjakFrontend.image.registry .Values.tornjakFrontend.image.repository .Values.tornjakFrontend.image.version -}} -{{- else -}} -{{- printf "%s/%s" .Values.tornjakFrontend.image.registry .Values.tornjakFrontend.image.repository -}} -{{- end -}} -{{- end }} - {{/* Create URL for accessing Tornjak APIs */}} diff --git a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml index eb2fe4d..116b9a1 100644 --- a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml +++ b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml @@ -24,7 +24,7 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ include "tornjak-frontend.fullname" . }} - image: {{ template "tornjak-frontend.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.image) }} + image: {{ template "spire-lib.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.image "global" .Values.global) }} imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }}