diff --git a/charts/simple-app/Chart.yaml b/charts/simple-app/Chart.yaml index 6a6fce1e..71910dab 100644 --- a/charts/simple-app/Chart.yaml +++ b/charts/simple-app/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: simple-app description: Default Microservice Helm Chart type: application -version: 0.9.4 +version: 0.9.5 appVersion: latest maintainers: - name: diranged diff --git a/charts/simple-app/README.md b/charts/simple-app/README.md index 876ae6ce..7c6845fd 100644 --- a/charts/simple-app/README.md +++ b/charts/simple-app/README.md @@ -2,7 +2,7 @@ Default Microservice Helm Chart -![Version: 0.9.4](https://img.shields.io/badge/Version-0.9.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 0.9.5](https://img.shields.io/badge/Version-0.9.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) [deployments]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ [hpa]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ diff --git a/charts/simple-app/templates/_helpers.tpl b/charts/simple-app/templates/_helpers.tpl index 041767d1..a2cde7db 100644 --- a/charts/simple-app/templates/_helpers.tpl +++ b/charts/simple-app/templates/_helpers.tpl @@ -34,10 +34,11 @@ Create chart name and version as used by the chart label. Common labels */}} {{- define "simple-app.labels" -}} +{{- $tag := default .Chart.AppVersion .Values.image.tag -}} helm.sh/chart: {{ include "simple-app.chart" . }} -{{ include "simple-app.selectorLabels" . }} -app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.image.tag | trunc 63 | replace ":" "_" | quote }} +app.kubernetes.io/version: {{ $tag | replace ":" "_" | trunc 63 | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{ include "simple-app.selectorLabels" . }} {{- end }} {{/* @@ -58,3 +59,24 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Proxy and Main App Image Names +*/}} +{{- define "simple-app.imageFqdn" -}} +{{- $tag := default .Chart.AppVersion .Values.image.tag }} +{{- if hasPrefix "sha256:" $tag }} +{{- .Values.image.repository }}@{{ $tag }} +{{- else }} +{{- .Values.image.repository }}:{{ $tag }} +{{- end }} +{{- end }} + +{{- define "simple-app.proxyImageFqdn" -}} +{{- $tag := .Values.proxySidecar.image.tag }} +{{- if hasPrefix "sha256:" $tag }} +{{- .Values.proxySidecar.image.repository }}@{{ $tag }} +{{- else }} +{{- .Values.proxySidecar.image.repository }}:{{ $tag }} +{{- end }} +{{- end }} diff --git a/charts/simple-app/templates/deployment.yaml b/charts/simple-app/templates/deployment.yaml index ce05879a..e9229f4e 100644 --- a/charts/simple-app/templates/deployment.yaml +++ b/charts/simple-app/templates/deployment.yaml @@ -41,7 +41,7 @@ spec: containers: {{- if .Values.proxySidecar.enabled }} - name: {{ .Values.proxySidecar.name }} - image: "{{ .Values.proxySidecar.image.repository }}:{{ .Values.proxySidecar.image.tag }}" + image: {{ include "simple-app.proxyImageFqdn" . }} imagePullPolicy: {{ .Values.proxySidecar.image.pullPolicy }} {{- with .Values.proxySidecar.envFrom }} envFrom: @@ -84,7 +84,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" + image: {{ include "simple-app.imageFqdn" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- with .Values.envFrom }} envFrom: diff --git a/charts/simple-app/templates/tests/test-connection.yaml b/charts/simple-app/templates/tests/test-connection.yaml index d1e49220..bb4999f3 100644 --- a/charts/simple-app/templates/tests/test-connection.yaml +++ b/charts/simple-app/templates/tests/test-connection.yaml @@ -14,7 +14,7 @@ spec: {{- if .Values.tests.connection.image.repository }} {{ .Values.tests.connection.image.repository }}:{{ default "latest" .Values.tests.connection.image.tag }} {{- else }} - {{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }} + {{ include "simple-app.imageFqdn" . }} {{- end }} command: {{- toYaml .Values.tests.connection.command | nindent 8 }} diff --git a/charts/simple-app/values.local.yaml b/charts/simple-app/values.local.yaml index 9d641d3b..e6613095 100644 --- a/charts/simple-app/values.local.yaml +++ b/charts/simple-app/values.local.yaml @@ -7,4 +7,3 @@ ingress: # -- Disable the SSL-Redirect explicitly because it only applies to # ALB-ingress controllers. sslRedirect: false -