Skip to content

Commit 685c31c

Browse files
[Monorepo] Change target verify-crd-compatibility to skip when CRD does not exist
- Resolved failure in the catalogd-crd-diff CI check caused by missing CRDs in the new repository. - Improved the CI and Makefile target to gracefully skip execution when the original CRD does not exist. Note: This is a temporary solution, and we may need to revisit and refine this check in the future.
1 parent ac354a3 commit 685c31c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

catalogd/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,12 @@ CRD_DIFF_ORIGINAL_REF := main
134134
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
135135
CRD_DIFF_CONFIG := crd-diff-config.yaml
136136
verify-crd-compatibility: $(CRD_DIFF)
137-
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml" ${CRD_DIFF_UPDATED_SOURCE}
137+
@if git show ${CRD_DIFF_ORIGINAL_REF}:config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml > /dev/null 2>&1; then \
138+
echo "Running CRD diff..."; \
139+
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml" ${CRD_DIFF_UPDATED_SOURCE}; \
140+
else \
141+
echo "Skipping CRD diff: CRD does not exist in ${CRD_DIFF_ORIGINAL_REF}"; \
142+
fi
138143

139144
.PHONY: lint
140145
lint: $(GOLANGCI_LINT) ## Run golangci linter.

0 commit comments

Comments
 (0)