From f4d1bc4a0e1d107193219389b5c4bf24b65cd871 Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Mon, 18 May 2020 10:58:57 +0200 Subject: [PATCH] [metricbeat] fix deployment upgrade by removing chart label from .spec.selector.matchLabels (#622) This fix metricbeat chart upgrades when .Chart.Version change. UPGRADE FAILED Error: Deployment.apps "metricbeat-metricbeat-metrics" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"metricbeat-metricbeat-metrics", "chart":"metricbeat-7.7.0", "heritage":"Tiller", "release":"metricbeat"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable Error: UPGRADE FAILED: Deployment.apps "metricbeat-metricbeat-metrics" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"metricbeat-metricbeat-metrics", "chart":"metricbeat-7.7.0", "heritage":"Tiller", "release":"metricbeat"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable See https://github.com/helm/charts/issues/7680 for more details --- metricbeat/templates/deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metricbeat/templates/deployment.yaml b/metricbeat/templates/deployment.yaml index ca056d42b..67eefabf8 100644 --- a/metricbeat/templates/deployment.yaml +++ b/metricbeat/templates/deployment.yaml @@ -13,7 +13,6 @@ spec: selector: matchLabels: app: '{{ template "metricbeat.fullname" . }}-metrics' - chart: '{{ .Chart.Name }}-{{ .Chart.Version }}' heritage: '{{ .Release.Service }}' release: '{{ .Release.Name }}' template: @@ -119,4 +118,4 @@ spec: {{- end }} {{- if .Values.extraContainers }} {{ tpl .Values.extraContainers . | indent 6 }} - {{- end }} \ No newline at end of file + {{- end }}