From 7284144b77a7a302d60ecd488a928e95da6a7e75 Mon Sep 17 00:00:00 2001 From: Wei-An Yen Date: Fri, 10 Jun 2022 15:19:50 +0800 Subject: [PATCH] fix: wrong variable calling (#8) --- Chart.yaml | 2 +- templates/_cronjob.yaml | 2 +- templates/_hpa.yaml | 2 +- templates/_pdb.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index ed47a80..2b5de62 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -14,4 +14,4 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.5.0 +version: 0.5.1 diff --git a/templates/_cronjob.yaml b/templates/_cronjob.yaml index 87e2c76..1c9855b 100644 --- a/templates/_cronjob.yaml +++ b/templates/_cronjob.yaml @@ -10,7 +10,7 @@ spec: {{- $cronJob := index . 1 }} {{- $pod := index . 2 }} {{- $serviceAccount := index . 3 }} -{{- if semverCompare ">=1.21.0" .Capabilities.KubeVersion.Version -}} +{{- if semverCompare ">=1.21.0" $top.Capabilities.KubeVersion.Version -}} apiVersion: batch/v1 {{- else -}} apiVersion: batch/v1beta1 diff --git a/templates/_hpa.yaml b/templates/_hpa.yaml index e58b9c9..282e986 100644 --- a/templates/_hpa.yaml +++ b/templates/_hpa.yaml @@ -3,7 +3,7 @@ {{- define "common.hpa.tpl" -}} {{- $top := first . }} {{- $autoscaling := index . 1 }} -{{- if semverCompare ">=1.23.0" .Capabilities.KubeVersion.Version -}} +{{- if semverCompare ">=1.23.0" $top.Capabilities.KubeVersion.Version -}} apiVersion: autoscaling/v2 {{- else -}} apiVersion: autoscaling/v2beta2 diff --git a/templates/_pdb.yaml b/templates/_pdb.yaml index d021d24..1780a94 100644 --- a/templates/_pdb.yaml +++ b/templates/_pdb.yaml @@ -3,7 +3,7 @@ {{- define "common.pdb.tpl" -}} {{- $top := first . }} {{- $pdb := index . 1 }} -{{- if semverCompare ">=1.21.0" .Capabilities.KubeVersion.Version -}} +{{- if semverCompare ">=1.21.0" $top.Capabilities.KubeVersion.Version -}} apiVersion: policy/v1 {{- else -}} apiVersion: policy/v1beta1