fix(cluster_setup): Always use global namespace in helpers

This commit is contained in:
Jim Martens 2024-02-03 22:12:38 +01:00
parent 2b606fb169
commit 1dcbf2ba7b
Signed by: 2martens
GPG Key ID: 47393ABD1F96B7C8
2 changed files with 18 additions and 18 deletions

View File

@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: cluster_setup name: cluster_setup
version: 0.5.0 version: 0.5.1
type: application type: application
description: "Initial cluster setup" description: "Initial cluster setup"
maintainers: maintainers:
@ -8,8 +8,8 @@ maintainers:
url: https://2martens.de url: https://2martens.de
annotations: annotations:
artifacthub.io/changes: | artifacthub.io/changes: |
- kind: added - kind: fixed
description: Added ability to use secret in multiple namespaces description: Always use global namespace in helpers
artifacthub.io/signKey: | artifacthub.io/signKey: |
fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8 fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8
url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc

View File

@ -2,7 +2,7 @@
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "template.name" -}} {{- define "template.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- default $.Chart.Name $.Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
{{/* {{/*
@ -11,14 +11,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name. If release name contains chart name it will be used as a full name.
*/}} */}}
{{- define "template.fullname" -}} {{- define "template.fullname" -}}
{{- if .Values.fullnameOverride }} {{- if $.Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- $.Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }} {{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }} {{- $name := default $.Chart.Name $.Values.nameOverride }}
{{- if contains $name .Release.Name }} {{- if contains $name $.Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- $.Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }} {{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- printf "%s-%s" $.Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
@ -27,7 +27,7 @@ If release name contains chart name it will be used as a full name.
Create chart name and version as used by the chart label. Create chart name and version as used by the chart label.
*/}} */}}
{{- define "template.chart" -}} {{- define "template.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- printf "%s-%s" $.Chart.Name $.Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
{{/* {{/*
@ -36,11 +36,11 @@ Common labels
{{- define "template.labels" -}} {{- define "template.labels" -}}
helm.sh/chart: {{ include "template.chart" $ }} helm.sh/chart: {{ include "template.chart" $ }}
{{ include "template.selectorLabels" $ }} {{ include "template.selectorLabels" $ }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- end }} {{- end }}
{{- define "template.annotations" -}} {{- define "template.annotations" -}}
meta.helm.sh/release-name: {{ .Release.Name }} meta.helm.sh/release-name: {{ $.Release.Name }}
meta.helm.sh/release-namespace: {{ .Release.Namespace }} meta.helm.sh/release-namespace: {{ $.Release.Namespace }}
{{- end }} {{- end }}
{{/* {{/*
@ -48,17 +48,17 @@ Selector labels
*/}} */}}
{{- define "template.selectorLabels" -}} {{- define "template.selectorLabels" -}}
app.kubernetes.io/name: {{ include "template.name" $ }} app.kubernetes.io/name: {{ include "template.name" $ }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ $.Release.Name }}
{{- end }} {{- end }}
{{/* {{/*
Create the name of the service account to use Create the name of the service account to use
*/}} */}}
{{- define "template.serviceAccountName" -}} {{- define "template.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }} {{- if $.Values.serviceAccount.create }}
{{- default (include "template.fullname" .) .Values.serviceAccount.name }} {{- default (include "template.fullname" .) $.Values.serviceAccount.name }}
{{- else }} {{- else }}
{{- default "default" .Values.serviceAccount.name }} {{- default "default" $.Values.serviceAccount.name }}
{{- end }} {{- end }}
{{- end }} {{- end }}