diff --git a/alertmanager.kubeVersion b/alertmanager.kubeVersion new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/charts/alertmanager/templates/_helpers.tpl b/charts/alertmanager/templates/_helpers.tpl index 827b6ee9f7da..b2c4f5cfc0a9 100644 --- a/charts/alertmanager/templates/_helpers.tpl +++ b/charts/alertmanager/templates/_helpers.tpl @@ -24,6 +24,13 @@ If release name contains chart name it will be used as a full name. {{- end }} {{- end }} +{{/* +Get KubeVersion removing pre-release information. +*/}} +{{- define "alertmanager.kubeVersion" -}} + {{- default .Capabilities.KubeVersion.Version (regexFind "v[0-9]+\\.[0-9]+\\.[0-9]+" .Capabilities.KubeVersion.Version) -}} +{{- end -}} + {{/* Create chart name and version as used by the chart label. */}}