Skip to content

Commit

Permalink
common: added vm.podLabels template (#1624)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk authored Oct 23, 2024
1 parent 69e8f8d commit 6842c6c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/victoria-metrics-common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Next release

- TODO
- Added vm.podLabels template

## 0.0.16

Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
type: library
description: Victoria Metrics Common - contains shared templates for all Victoria Metrics helm charts
name: victoria-metrics-common
version: 0.0.16
version: 0.0.17
sources:
- https://github.com/VictoriaMetrics/helm-charts
kubeVersion: ">=1.23.0-0"
Expand Down
9 changes: 9 additions & 0 deletions charts/victoria-metrics-common/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ If release name contains chart name it will be used as a full name.
{{- toYaml $labels -}}
{{- end -}}

{{- define "vm.podLabels" -}}
{{- include "vm.validate.args" . -}}
{{- $Release := (.helm).Release | default .Release -}}
{{- $labels := fromYaml (include "vm.selectorLabels" .) -}}
{{- $labels = mergeOverwrite $labels (.extraLabels | default dict) -}}
{{- $_ := set $labels "app.kubernetes.io/managed-by" $Release.Service -}}
{{- toYaml $labels -}}
{{- end -}}

{{- /* Common labels */ -}}
{{- define "vm.labels" -}}
{{- include "vm.validate.args" . -}}
Expand Down

0 comments on commit 6842c6c

Please sign in to comment.