From 95de995efd06f5beedfe81e2e8b4dfcc164fd9ec Mon Sep 17 00:00:00 2001 From: Anatoly Bezgubov Date: Wed, 8 Apr 2020 16:25:43 +0300 Subject: [PATCH] [stable/elastalert]: improve templates - add variables for override fullname of chart (#21800) * bump chart Signed-off-by: Anatoly Bezgubov Co-authored-by: Anatoly Bezgubov --- stable/elastalert/Chart.yaml | 2 +- stable/elastalert/templates/_helpers.tpl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stable/elastalert/Chart.yaml b/stable/elastalert/Chart.yaml index 5bceb1a52f..de889e6710 100644 --- a/stable/elastalert/Chart.yaml +++ b/stable/elastalert/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: ElastAlert is a simple framework for alerting on anomalies, spikes, or other patterns of interest from data in Elasticsearch. name: elastalert -version: 1.2.3 +version: 1.2.4 appVersion: 0.2.1 home: https://github.com/Yelp/elastalert icon: https://static-www.elastic.co/assets/blteb1c97719574938d/logo-elastic-elasticsearch-lt.svg diff --git a/stable/elastalert/templates/_helpers.tpl b/stable/elastalert/templates/_helpers.tpl index 5bce880edd..6e62bee649 100644 --- a/stable/elastalert/templates/_helpers.tpl +++ b/stable/elastalert/templates/_helpers.tpl @@ -9,8 +9,17 @@ Expand the name of the chart. {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. */}} {{- define "elastalert.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} +{{- end -}}