rancher-charts/packages/rancher-prom2teams/generated-changes/patch/templates/_helpers.tpl.patch

58 lines
1.7 KiB
Diff

--- charts-original/templates/_helpers.tpl
+++ charts/templates/_helpers.tpl
@@ -1,4 +1,31 @@
{{/* vim: set filetype=mustache: */}}
+
+{{- define "system_default_registry" -}}
+{{- if .Values.global.cattle.systemDefaultRegistry -}}
+{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Windows cluster will add default taint for linux nodes,
+add below linux tolerations to workloads could be scheduled to those linux nodes
+*/}}
+
+{{- define "linux-node-tolerations" -}}
+- key: "cattle.io/os"
+ value: "linux"
+ effect: "NoSchedule"
+ operator: "Equal"
+{{- end -}}
+
+{{- define "linux-node-selector" -}}
+{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
+beta.kubernetes.io/os: linux
+{{- else -}}
+kubernetes.io/os: linux
+{{- end -}}
+{{- end -}}
+
{{/*
Expand the name of the chart.
*/}}
@@ -25,10 +52,10 @@
{{- end -}}
{{/*
-Create chart name and version as used by the chart label.
+Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
-{{- define "prom2teams.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- define "prom2teams.namespace" -}}
+{{ default .Release.Namespace .Values.global.namespaceOverride }}
{{- end -}}
{{/*
@@ -36,7 +63,7 @@
*/}}
{{- define "prom2teams.labels" -}}
app.kubernetes.io/name: {{ include "prom2teams.name" . }}
-helm.sh/chart: {{ include "prom2teams.chart" . }}
+helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
{{- if .Chart.AppVersion }}