diff --git a/deploy/chart/Chart.yaml b/deploy/chart/Chart.yaml index 1e8d803..5207a95 100644 --- a/deploy/chart/Chart.yaml +++ b/deploy/chart/Chart.yaml @@ -7,3 +7,6 @@ type: application # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) version: 0.1.0 + +# This is the version of the application, i.e. openshift-routes +appVersion: 0.2.0 diff --git a/deploy/chart/templates/_helpers.tpl b/deploy/chart/templates/_helpers.tpl index 751b1bc..6e9ac42 100644 --- a/deploy/chart/templates/_helpers.tpl +++ b/deploy/chart/templates/_helpers.tpl @@ -59,14 +59,16 @@ Create the name of the service account to use {{- end }} {{- end }} - {{/* -The final, full image reference +Util function for generating the image URL based on the provided options. +IMPORTANT: This function is standarized across all charts in the cert-manager GH organization. +Any changes to this function should also be made in cert-manager, trust-manager, approver-policy, ... +See https://github.com/cert-manager/cert-manager/issues/6329 for a list of linked PRs. */}} {{- define "openshift-routes.image" -}} -{{- if .Values.image.digest }} -{{- .Values.image.registry }}/{{ .Values.image.repository }}@{{ .Values.image.digest }} -{{- else }} -{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository .Values.image.tag }} +{{- $defaultTag := index . 1 -}} +{{- with index . 0 -}} +{{- if .registry -}}{{ printf "%s/%s" .registry .repository }}{{- else -}}{{- .repository -}}{{- end -}} +{{- if .digest -}}{{ printf "@%s" .digest }}{{- else -}}{{ printf ":%s" (default $defaultTag .tag) }}{{- end -}} {{- end }} {{- end }} diff --git a/deploy/chart/templates/deployment.yaml b/deploy/chart/templates/deployment.yaml index 577df38..61cc995 100644 --- a/deploy/chart/templates/deployment.yaml +++ b/deploy/chart/templates/deployment.yaml @@ -30,7 +30,7 @@ spec: - name: openshift-routes securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ include "openshift-routes.image" . }} + image: "{{ template "openshift-routes.image" (tuple .Values.image $.Chart.AppVersion) }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - "-v={{ .Values.logLevel }}" diff --git a/deploy/chart/values.yaml b/deploy/chart/values.yaml index 59d8b8a..d3208e4 100644 --- a/deploy/chart/values.yaml +++ b/deploy/chart/values.yaml @@ -7,13 +7,21 @@ fullnameOverride: "" image: # https://github.com/cert-manager/openshift-routes/pkgs/container/cert-manager-openshift-routes - registry: ghcr.io - repository: cert-manager/cert-manager-openshift-routes - # the final image is generated as "${registry}/${repostiory}:${tag}" - tag: "0.2.0" - # if "digest" is set, overrides "tag" - # digest: "sha256:..." - pullPolicy: IfNotPresent + # the final image is generated as "${registry}/${repostiory}:${tag|digest}" + + # -- Target image repository. + repository: ghcr.io/cert-manager/cert-manager-openshift-routes + # -- Target image registry. Will be prepended to the target image repositry if set. + registry: + + # -- Target image version tag. Defaults to the chart's appVersion. + tag: + + # -- Target image digest. Will override any tag if set. + # for example: + # digest: sha256:0e072dddd1f7f8fc8909a2ca6f65e76c5f0d2fcfb8be47935ae3457e8bbceb20 + digest: + imagePullSecrets: []