Skip to content

Commit

Permalink
Don't install CRDs when the api is already registered.
Browse files Browse the repository at this point in the history
  • Loading branch information
AMecea committed Dec 19, 2018
1 parent 466ce85 commit 2a49e6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hack/charts/mysql-operator/templates/crds.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.installCRDs }}
{{- if (and .Values.installCRDs (not (.Capabilities.APIVersions.Has "mysql.presslabs.org/v1alpha1"))) }}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down
2 changes: 1 addition & 1 deletion hack/generate_chart_manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ yq d -d'*' -i ${CHART_PATH}/templates/_crds.yaml spec.validation
yq w -d1 -i ${CHART_PATH}/templates/_crds.yaml 'spec.names.shortNames[0]' mysql


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

0 comments on commit 2a49e6d

Please sign in to comment.