Skip to content

Commit 2a49e6d

Browse files
committed
Don't install CRDs when the api is already registered.
1 parent 466ce85 commit 2a49e6d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hack/charts/mysql-operator/templates/crds.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.installCRDs }}
1+
{{- if (and .Values.installCRDs (not (.Capabilities.APIVersions.Has "mysql.presslabs.org/v1alpha1"))) }}
22
apiVersion: apiextensions.k8s.io/v1beta1
33
kind: CustomResourceDefinition
44
metadata:

hack/generate_chart_manifests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ yq d -d'*' -i ${CHART_PATH}/templates/_crds.yaml spec.validation
1515
yq w -d1 -i ${CHART_PATH}/templates/_crds.yaml 'spec.names.shortNames[0]' mysql
1616

1717

18-
echo '{{- if .Values.installCRDs }}' > ${CHART_PATH}/templates/crds.yaml
18+
echo '{{- if (and .Values.installCRDs (not (.Capabilities.APIVersions.Has "mysql.presslabs.org/v1alpha1"))) }}' > ${CHART_PATH}/templates/crds.yaml
1919
cat ${CHART_PATH}/templates/_crds.yaml >> ${CHART_PATH}/templates/crds.yaml
2020
echo '{{- end }}' >> ${CHART_PATH}/templates/crds.yaml
2121
rm ${CHART_PATH}/templates/_crds.yaml

0 commit comments

Comments
 (0)