diff --git a/helm/opsy/templates/_helpers.tpl b/helm/opsy/templates/_helpers.tpl index 061faa5..8097fc6 100644 --- a/helm/opsy/templates/_helpers.tpl +++ b/helm/opsy/templates/_helpers.tpl @@ -36,7 +36,7 @@ Common labels */}} {{- define "opsy.labels" -}} app.kubernetes.io/name: {{ include "opsy.name" . }} -helm.sh/chart: {{ include "opsy.chart" . }} +helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} @@ -49,7 +49,7 @@ Migration labels */}} {{- define "opsy.migrationLabels" -}} app.kubernetes.io/name: {{ include "opsy.name" . }}-database-migrations -helm.sh/chart: {{ include "opsy.chart" . }} +helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} diff --git a/helm/opsy/templates/database_migration.yaml b/helm/opsy/templates/database_migration.yaml index f40783c..ea1d9a5 100644 --- a/helm/opsy/templates/database_migration.yaml +++ b/helm/opsy/templates/database_migration.yaml @@ -14,11 +14,7 @@ spec: metadata: name: {{ include "opsy.fullname" . }}-database-migration labels: - app: {{ include "opsy.fullname" . }} - app.kubernetes.io/name: {{ include "opsy.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +{{ include "opsy.migrationLabels" . | indent 8 }} annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} diff --git a/helm/opsy/templates/deployment.yaml b/helm/opsy/templates/deployment.yaml index cfc0fa3..f874e3c 100644 --- a/helm/opsy/templates/deployment.yaml +++ b/helm/opsy/templates/deployment.yaml @@ -13,11 +13,7 @@ spec: template: metadata: labels: - app: {{ include "opsy.fullname" . }} - app.kubernetes.io/name: {{ include "opsy.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +{{ include "opsy.labels" . | indent 8 }} annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}