Adds some kubernetes recommended labels to few places that was missing. (#1307)

This commit is contained in:
Stavros Kois
2023-07-03 14:56:01 +03:00
committed by GitHub
parent 65119bdd9f
commit f4db9bcfdc
11 changed files with 37 additions and 2 deletions

View File

@@ -5,6 +5,8 @@
{{- define "ix.v1.common.lib.metadata.allLabels" -}}
helm.sh/chart: {{ include "ix.v1.common.lib.chart.names.chart" . }}
helm-revision: {{ .Release.Revision | quote }}
app.kubernetes.io/name: {{ include "ix.v1.common.lib.chart.names.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app: {{ include "ix.v1.common.lib.chart.names.chart" . }}

View File

@@ -9,18 +9,27 @@
{{- $annotations := .annotations -}}
{{- $rootCtx := .rootCtx -}}
{{- $seenLabels := list -}}
{{- $seenAnnotations := list -}}
{{- with $labels -}}
{{- range $k, $v := . -}}
{{- if and $k $v }}
{{- if and $k $v -}}
{{- if not (mustHas $k $seenLabels) }}
{{ $k }}: {{ tpl $v $rootCtx | quote }}
{{- $seenLabels = mustAppend $seenLabels $k -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- with $annotations -}}
{{- range $k, $v := . -}}
{{- if and $k $v }}
{{- if and $k $v -}}
{{- if not (mustHas $k $seenAnnotations) }}
{{ $k }}: {{ tpl $v $rootCtx | quote }}
{{- $seenAnnotations = mustAppend $seenAnnotations $k -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}