From ce886258b33534957317188fff4ed9afc978a18d Mon Sep 17 00:00:00 2001 From: Adam Berlin Date: Fri, 21 Oct 2022 11:55:48 -0400 Subject: [PATCH] Adds installCrd flag to helm chart values. This solves the user experience problem of reading the documentation about the CRD, running helm install, and not being able to see the CRD in the api-resources. Previously the CRD was only installed if the datasource was crd, or the crdMigrationMode was turned on, which was a confusing experience for me as a newcomer. Authored-by: Adam Berlin Signed-off-by: Adam Berlin --- charts/log-router/{crds => templates}/crd.yaml | 10 ++++++++++ charts/log-router/values.yaml | 3 +++ 2 files changed, 13 insertions(+) rename charts/log-router/{crds => templates}/crd.yaml (73%) diff --git a/charts/log-router/crds/crd.yaml b/charts/log-router/templates/crd.yaml similarity index 73% rename from charts/log-router/crds/crd.yaml rename to charts/log-router/templates/crd.yaml index 17dfd060..e26cde73 100644 --- a/charts/log-router/crds/crd.yaml +++ b/charts/log-router/templates/crd.yaml @@ -1,3 +1,12 @@ +{{ if .Values.installCrd }} +{{- /* if we need the CRD, install it */ -}} + +{{/* + this CRD needs to live in the template directory because CRDs within the + chart crds/ directory are not processed as templates +*/}} + +# # log-router CRD resource: apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -26,3 +35,4 @@ spec: type: object served: true storage: true +{{ end }} \ No newline at end of file diff --git a/charts/log-router/values.yaml b/charts/log-router/values.yaml index 882cc4ac..6ac76940 100755 --- a/charts/log-router/values.yaml +++ b/charts/log-router/values.yaml @@ -21,6 +21,9 @@ datasource: default # together with the specified legacy datasource to facilitate the migration process to CRDs. crdMigrationMode: false +# default to installing the CRD along with the helm chart +installCrd: true + defaultConfigmap: "fluentd-config" image: