From 4599449c8f38ff994980d27fa6bf63f6242c6308 Mon Sep 17 00:00:00 2001 From: Kenan Warren Date: Tue, 14 Sep 2021 14:26:34 -0400 Subject: [PATCH] Resolve issue where min supported cronjob wasn't calculated correctly by helm --- charts/graph-kubernetes/Chart.yaml | 2 +- charts/graph-kubernetes/templates/_helpers.tpl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/graph-kubernetes/Chart.yaml b/charts/graph-kubernetes/Chart.yaml index 3aff754..365366f 100644 --- a/charts/graph-kubernetes/Chart.yaml +++ b/charts/graph-kubernetes/Chart.yaml @@ -3,5 +3,5 @@ name: graph-kubernetes description: Converts K8s resources into a graph model for ingestion into JupiterOne. type: application -version: 0.2.0 +version: 0.2.1 appVersion: '0.3.1' diff --git a/charts/graph-kubernetes/templates/_helpers.tpl b/charts/graph-kubernetes/templates/_helpers.tpl index 8cca3c0..8f2d9eb 100644 --- a/charts/graph-kubernetes/templates/_helpers.tpl +++ b/charts/graph-kubernetes/templates/_helpers.tpl @@ -86,9 +86,10 @@ Return the appropriate apiVersion for rbac. {{/* Return the appropriate apiVersion for cronjob. +We also add an extra check on the minimum k8s version because not all vendors */}} {{- define "cronjob.apiVersion" -}} -{{- if .Capabilities.APIVersions.Has "batch/v1" }} +{{- if and (.Capabilities.APIVersions.Has "batch/v1") (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.GitVersion) }} {{- print "batch/v1" -}} {{- else -}} {{- print "batch/v1beta1" -}}