Extend shared library for naming functions
This commit is contained in:
parent
5e17b545a9
commit
2b75664215
@ -2,7 +2,7 @@ apiVersion: v2
|
|||||||
name: kubezero-lib
|
name: kubezero-lib
|
||||||
description: KubeZero helm library - common helm functions and blocks
|
description: KubeZero helm library - common helm functions and blocks
|
||||||
type: library
|
type: library
|
||||||
version: 0.1.2
|
version: 0.1.3
|
||||||
home: https://kubezero.com
|
home: https://kubezero.com
|
||||||
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png
|
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png
|
||||||
keywords:
|
keywords:
|
||||||
|
@ -3,6 +3,27 @@ Common set of labels
|
|||||||
*/ -}}
|
*/ -}}
|
||||||
{{- define "kubezero-lib.labels" -}}
|
{{- define "kubezero-lib.labels" -}}
|
||||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||||
|
app.kubernetes.io/name: {{ include "kubezero-lib.name" . }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
app.kubernetes.io/part-of: kubezero
|
app.kubernetes.io/part-of: kubezero
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /*
|
||||||
|
Common naming functions
|
||||||
|
*/ -}}
|
||||||
|
{{- define "kubezero-lib.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "kubezero-lib.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 -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user