Browse Source

Only generate create flags for cluster scoped crds

Eric Chan 4 years ago
parent
commit
e132edf0d4

+ 7 - 3
Makefile

@@ -181,9 +181,13 @@ helm.generate:
 	done
 	done
 # Add helm if statement for controlling the install of CRDs
 # Add helm if statement for controlling the install of CRDs
 	@for i in $(HELM_DIR)/templates/crds/*.yml; do \
 	@for i in $(HELM_DIR)/templates/crds/*.yml; do \
-		CRDS_FLAG_NAME="create$$(yq '.spec.names.kind' $$i)" && \
-		cp "$$i" "$$i.bkp" && \
-		echo "{{- if and (.Values.installCRDs) (.Values.crds.$$CRDS_FLAG_NAME) }}" > "$$i" && \
+		export CRDS_FLAG_NAME="create$$(yq '.spec.names.kind' $$i)"; \
+		cp "$$i" "$$i.bkp"; \
+		if [[ "$$CRDS_FLAG_NAME" == *"Cluster"* ]]; then \
+			echo "{{- if and (.Values.installCRDs) (.Values.crds.$$CRDS_FLAG_NAME) }}" > "$$i"; \
+		else \
+			echo "{{- if .Values.installCRDs }}" > "$$i"; \
+		fi; \
 		cat "$$i.bkp" >> "$$i" && \
 		cat "$$i.bkp" >> "$$i" && \
 		echo "{{- end }}" >> "$$i" && \
 		echo "{{- end }}" >> "$$i" && \
 		rm "$$i.bkp" && \
 		rm "$$i.bkp" && \

+ 1 - 3
deploy/charts/external-secrets/README.md

@@ -64,9 +64,7 @@ The command removes all the Kubernetes components associated with the chart and
 | concurrent | int | `1` | Specifies the number of concurrent ExternalSecret Reconciles external-secret executes at a time. |
 | concurrent | int | `1` | Specifies the number of concurrent ExternalSecret Reconciles external-secret executes at a time. |
 | controllerClass | string | `""` | If set external secrets will filter matching Secret Stores with the appropriate controller values. |
 | controllerClass | string | `""` | If set external secrets will filter matching Secret Stores with the appropriate controller values. |
 | crds.createClusterExternalSecret | bool | `true` | If true, create CRDs for Cluster External Secret. |
 | crds.createClusterExternalSecret | bool | `true` | If true, create CRDs for Cluster External Secret. |
-| crds.createClusterSecretStore | bool | `true` | If true, create CRDs for Secret Store. |
-| crds.createExternalSecret | bool | `true` | If true, create CRDs for External Secret. |
-| crds.createSecretStore | bool | `true` | If true, create CRDs for Secret Store. |
+| crds.createClusterSecretStore | bool | `true` | If true, create CRDs for Cluster Secret Store. |
 | createOperator | bool | `true` | Specifies whether an external secret operator deployment be created. |
 | createOperator | bool | `true` | Specifies whether an external secret operator deployment be created. |
 | deploymentAnnotations | object | `{}` | Annotations to add to Deployment |
 | deploymentAnnotations | object | `{}` | Annotations to add to Deployment |
 | extraArgs | object | `{}` |  |
 | extraArgs | object | `{}` |  |

+ 1 - 5
deploy/charts/external-secrets/values.yaml

@@ -12,12 +12,8 @@ installCRDs: true
 crds:
 crds:
   # -- If true, create CRDs for Cluster External Secret.
   # -- If true, create CRDs for Cluster External Secret.
   createClusterExternalSecret: true
   createClusterExternalSecret: true
-  # -- If true, create CRDs for Secret Store.
+  # -- If true, create CRDs for Cluster Secret Store.
   createClusterSecretStore: true
   createClusterSecretStore: true
-  # -- If true, create CRDs for External Secret.
-  createExternalSecret: true
-  # -- If true, create CRDs for Secret Store.
-  createSecretStore: true
 
 
 imagePullSecrets: []
 imagePullSecrets: []
 nameOverride: ""
 nameOverride: ""