From 6885f430b74812cd6e295113df25f52a415fe8c8 Mon Sep 17 00:00:00 2001 From: peterabarr <90917602+peterabarr@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:00:08 +0100 Subject: [PATCH] Add to templates file Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> --- alertmanager.kubeVersion | 0 charts/alertmanager/templates/_helpers.tpl | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 alertmanager.kubeVersion 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. */}}