Browse Source

Allow specifying extra selector labels

Waqar Ahmed 4 years ago
parent
commit
0960e8b2cd
1 changed files with 5 additions and 0 deletions
  1. 5 0
      library/common/2101.0.0/templates/lib/chart/_labels.tpl

+ 5 - 0
library/common/2101.0.0/templates/lib/chart/_labels.tpl

@@ -16,4 +16,9 @@ Selector labels shared across objects.
 {{- define "common.labels.selectorLabels" -}}
 app.kubernetes.io/name: {{ include "common.names.name" . }}
 app.kubernetes.io/instance: {{ include "common.names.releaseName" . }}
+{{ if hasKey .Values "extraSelectorLabels" }}
+{{ range $selector := .Values.extraSelectorLabels }}
+{{ printf "%s: %s" $selector.key $selector.value }}
+{{ end }}
+{{ end }}
 {{- end }}