Skip to content

Commit

Permalink
Fix crd generation and checking
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth committed Nov 1, 2024
1 parent ddb98c3 commit 5414417
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ check-operator-crds:
$(call get-crd,${TMP_DIRECTORY}/crds/crd-opentelemetryinstrumentation.yaml,https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/v$(OPERATOR_APP_VERSION)/bundle/community/manifests/opentelemetry.io_instrumentations.yaml)
$(call get-crd,${TMP_DIRECTORY}/crds/crd-opentelemetry.io_opampbridges.yaml,https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/v$(OPERATOR_APP_VERSION)/bundle/community/manifests/opentelemetry.io_opampbridges.yaml)

@sed -i '/{{- if \.Values\.admissionWebhooks\.create }}/d' "./charts/opentelemetry-operator/conf/crds/crd-opentelemetrycollector.yaml"
@sed -i '0,/{{- end }}/{/{{- end }}/d}' "./charts/opentelemetry-operator/conf/crds/crd-opentelemetrycollector.yaml"

if diff ${TMP_DIRECTORY}/crds ./charts/opentelemetry-operator/conf/crds > /dev/null; then \
echo "Passed"; \
rm -rf ${TMP_DIRECTORY}; \
Expand All @@ -91,5 +88,7 @@ define get-crd
@sed -i 's/opentelemetry-operator-webhook-service/{{ template "opentelemetry-operator.fullname" . }}-webhook/g' $(1)
@sed -i '1s/^/{{- if .Values.crds.create }}\n/' $(1)
@sed -i 's#\(.*\)path: /convert#&\n\1port: {{ .Values.admissionWebhooks.servicePort }}#' $(1)
@sed -i 's#\(.*\)conversion:#{{- if .Values.admissionWebhooks.create }}\n&#' $(1)
@sed -i 's#\(.*\)- v1beta1#&\n{{- end }}#' $(1)
@echo '{{- end }}' >> $(1)
endef

0 comments on commit 5414417

Please sign in to comment.