Skip to content

Commit

Permalink
fix(vault-operator helm chart): added missing common.capabilities.kub…
Browse files Browse the repository at this point in the history
…eVersion and common.capabilities.policy.apiVersion template definitions. (#527)

Signed-off-by: virtyaluk <[email protected]>
  • Loading branch information
virtyaluk authored Jul 28, 2024
1 parent c28e2f6 commit 3bc6fe5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions deploy/charts/vault-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Return the target Kubernetes version
*/}}
{{- define "common.capabilities.kubeVersion" -}}
{{- default (default .Capabilities.KubeVersion.Version .Values.kubeVersion) ((.Values.global).kubeVersion) -}}
{{- end -}}

{{/*
Return the appropriate apiVersion for poddisruptionbudget.
*/}}
{{- define "common.capabilities.policy.apiVersion" -}}
{{- $kubeVersion := include "common.capabilities.kubeVersion" . -}}
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.21-0" $kubeVersion) -}}
{{- print "policy/v1beta1" -}}
{{- else -}}
{{- print "policy/v1" -}}
{{- end -}}
{{- end -}}

{{/*
Expand the name of the chart.
*/}}
Expand Down

0 comments on commit 3bc6fe5

Please sign in to comment.