From f3c89574464373049ba534aef7c878a7b9cc30c6 Mon Sep 17 00:00:00 2001 From: Joss Whittle Date: Wed, 6 Mar 2024 17:41:18 +0000 Subject: [PATCH] feat: add a check that the crds are installed when deploying the controller (#3) --- .../guacamole/templates/controller/controller-deployment.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/guacamole/templates/controller/controller-deployment.yaml b/charts/guacamole/templates/controller/controller-deployment.yaml index 2187a6f..79ae7c9 100644 --- a/charts/guacamole/templates/controller/controller-deployment.yaml +++ b/charts/guacamole/templates/controller/controller-deployment.yaml @@ -1,4 +1,7 @@ {{- if .Values.controller.enabled }} +{{- if not (.Capabilities.APIVersions.Has "guacamole.ukserp.ac.uk/v1") }} +{{- fail "Guacamole CRDs not installed!" }} +{{- end }} {{- $podNodeSelector := include "guacamole.podNodeSelector" (dict "Release" .Release "Values" .Values "nodeSelector" .Values.controller.nodeSelector) }} {{- $podAffinity := include "guacamole.podAffinity" (dict "Release" .Release "Values" .Values "affinity" .Values.controller.affinity) }} {{- $podTolerations := include "guacamole.podTolerations" (dict "Release" .Release "Values" .Values "tolerations" .Values.controller.tolerations) }}