From 7b7e2935d01668eb54f2a26bbad4343be88bf1dd Mon Sep 17 00:00:00 2001 From: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:23:41 +0530 Subject: [PATCH] feat: add imagePullPolicy helper function to common chart (#125) --- charts/common/Chart.yaml | 2 +- charts/common/templates/_images.tpl | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index bab1902..a95aebd 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -15,4 +15,4 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.2 diff --git a/charts/common/templates/_images.tpl b/charts/common/templates/_images.tpl index 64c2b5d..877a3e5 100644 --- a/charts/common/templates/_images.tpl +++ b/charts/common/templates/_images.tpl @@ -51,6 +51,17 @@ Return the proper Image Registry Secret Names evaluating values as templates {{- end -}} {{- end -}} +{{/* + Checks for the imagePullPolicy +*/}} +{{- define "common.imagePullPolicy" -}} + {{- if .Values.global.imagePullPolicy -}} + {{- .Values.global.imagePullPolicy -}} + {{- else -}} + {{- default .Values.imagePullPolicy -}} + {{- end -}} +{{- end -}} + {{- if (not (empty $pullSecrets)) }} imagePullSecrets: {{- range $pullSecrets | uniq }}