feat(common): add support for a, renovate compatible, image selector (#1627)
This commit is contained in:
@@ -15,4 +15,4 @@ maintainers:
|
||||
name: common
|
||||
sources: null
|
||||
type: library
|
||||
version: 8.9.27
|
||||
version: 8.10.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{- /* The main container included in the controller */ -}}
|
||||
{{- define "common.controller.mainContainer" -}}
|
||||
- name: {{ include "common.names.fullname" . }}
|
||||
image: {{ printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) | quote }}
|
||||
image: {{ include "common.images.selector" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
{{- with .Values.command }}
|
||||
command:
|
||||
|
||||
@@ -9,6 +9,21 @@ Return the proper image name
|
||||
{{- printf "%s:%s" $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the image name using the selector
|
||||
{{ include "common.images.selector" . }}
|
||||
*/}}
|
||||
{{- define "common.images.selector" -}}
|
||||
{{- $imageDict := get .Values "image" }}
|
||||
{{- $selected := .Values.imageSelector }}
|
||||
{{- if hasKey .Values $selected }}
|
||||
{{- $imageDict = get .Values $selected }}
|
||||
{{- end }}
|
||||
{{- $repositoryName := $imageDict.repository -}}
|
||||
{{- $tag :=$imageDict.tag | toString -}}
|
||||
{{- printf "%s:%s" $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead)
|
||||
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
|
||||
|
||||
@@ -119,6 +119,10 @@ image:
|
||||
# -- image pull policy
|
||||
pullPolicy:
|
||||
|
||||
# -- Image Selector allows for easy picking a different image dict, important for the SCALE GUI
|
||||
imageSelector: "image"
|
||||
|
||||
|
||||
# -- Override the command(s) for the default container
|
||||
command: []
|
||||
# -- Override the args for the default container
|
||||
|
||||
Reference in New Issue
Block a user