From 4371671e4ea3e519202047d3b25008215511bc69 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Tue, 12 Jul 2022 10:22:09 -0400 Subject: [PATCH] fix: Use HELM 3 best practices for CRDs Current logic uses helm2 style conditions for CRDs which may or may not be installed prior to use when included in a subchart or as part of CD. Simply removing the if condition from the CRD sync step in the make file allows the helm3 supported method of opt out ``--skip-crds`` Signed-off-by: Ryan Faircloth --- Makefile | 5 +---- charts/zookeeper/README.md | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9017f757..408cce8d 100644 --- a/Makefile +++ b/Makefile @@ -113,10 +113,7 @@ all: generate check build generate: $(CONTROLLER_GEN) object paths="./..." make manifests - # sync crd generated to helm-chart - echo '{{- if .Values.crd.create }}' > charts/zookeeper-operator/templates/zookeeper.pravega.io_zookeeperclusters_crd.yaml - cat config/crd/bases/zookeeper.pravega.io_zookeeperclusters.yaml >> charts/zookeeper-operator/templates/zookeeper.pravega.io_zookeeperclusters_crd.yaml - echo '{{- end }}' >> charts/zookeeper-operator/templates/zookeeper.pravega.io_zookeeperclusters_crd.yaml + cp -f config/crd/bases/zookeeper.pravega.io_zookeeperclusters.yaml charts/zookeeper-operator/templates/zookeeper.pravega.io_zookeeperclusters_crd.yaml build: test build-go build-image diff --git a/charts/zookeeper/README.md b/charts/zookeeper/README.md index 8d0417bd..1f26a8e2 100644 --- a/charts/zookeeper/README.md +++ b/charts/zookeeper/README.md @@ -25,6 +25,7 @@ where: - **[RELEASE_NAME]** is the release name for the zookeeper chart. - **[CLUSTER_NAME]** is the name of the zookeeper cluster so created. (If [RELEASE_NAME] contains the string `zookeeper`, `[CLUSTER_NAME] = [RELEASE_NAME]`, else `[CLUSTER_NAME] = [RELEASE_NAME]-zookeeper`. The [CLUSTER_NAME] can however be overridden by providing `--set fullnameOverride=[CLUSTER_NAME]` along with the helm install command) - **[VERSION]** can be any stable release version for zookeeper from 0.2.8 onwards. +- `--skip-crds` may be used to ommit CRDs when seperatly installed and the current user context does not have required privlidges to install [best practices](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you) This command deploys zookeeper on the Kubernetes cluster in its default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.