From 400720c803135f119edfbb7d58b7905010398e14 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Tue, 8 Nov 2022 23:47:07 +0200 Subject: [PATCH] add capabilities --- .../templates/lib/chart/_capabilities.tpl | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 library/common/1.0.0/templates/lib/chart/_capabilities.tpl diff --git a/library/common/1.0.0/templates/lib/chart/_capabilities.tpl b/library/common/1.0.0/templates/lib/chart/_capabilities.tpl new file mode 100644 index 0000000000..07bad03439 --- /dev/null +++ b/library/common/1.0.0/templates/lib/chart/_capabilities.tpl @@ -0,0 +1,28 @@ +{{/* +Return the appropriate apiVersion for controllers +*/}} +{{- define "ix.v1.common.capabilities.controller.apiVersion" -}} + {{- if eq .Values.controller.type "deployment" -}} + {{- print "apps/v1" -}} + {{- else if eq .Values.controller.type "daemonset" -}} + {{- print "apps/v1" -}} + {{- else if eq .Values.controller.type "statefulset" -}} + {{- print "apps/v1" -}} + {{- else -}} + {{- fail (printf "Not a valid controller.type (%s)" .Values.controller.type) -}} + {{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for CronJob +*/}} +{{- define "ix.v1.common.capabilities.cronJob.apiVersion" -}} + {{- print "batch/v1" -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for Job +*/}} +{{- define "ix.v1.common.capabilities.job.apiVersion" -}} + {{- print "batch/v1" -}} +{{- end -}}