-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gabor Pichner
committed
Dec 26, 2023
1 parent
85884d5
commit ef0fb56
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{{/* | ||
Create HomeAssistant app version | ||
*/}} | ||
{{- define "home-assistant.defaultTag" -}} | ||
{{- default .Chart.AppVersion .Values.image.tag }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "home-assistant.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return valid version label | ||
*/}} | ||
{{- define "home-assistant.versionLabelValue" -}} | ||
{{ regexReplaceAll "[^-A-Za-z0-9_.]" (include "home-assistant.defaultTag" .) "-" | trunc 63 | trimAll "-" | trimAll "_" | trimAll "." | quote }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "home-assistant.labels" -}} | ||
helm.sh/chart: {{ include "home-assistant.chart" .context }} | ||
{{ include "home-assistant.selectorLabels" (dict "context" .context "component" .component "name" .name) }} | ||
app.kubernetes.io/managed-by: {{ .context.Release.Service }} | ||
app.kubernetes.io/part-of: home-assistant | ||
app.kubernetes.io/version: {{ include "home-assistant.versionLabelValue" .context }} | ||
{{- with .context.Values.additionalLabels }} | ||
{{ toYaml . }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "home-assistant.selectorLabels" -}} | ||
{{- if .name -}} | ||
app.kubernetes.io/name: {{ include "home-assistant.name" .context }}-{{ .name }} | ||
{{ end -}} | ||
app.kubernetes.io/instance: {{ .context.Release.Name }} | ||
{{- if .component }} | ||
app.kubernetes.io/component: {{ .component }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters