Skip to content

Commit bc1b04a

Browse files
Fix catalogd-crd-diff CI check
1 parent d4a35a2 commit bc1b04a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

catalogd/Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,14 @@ verify: tidy fmt vet generate ## Verify the current code generation and lint
135135
CRD_DIFF_ORIGINAL_REF := main
136136
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
137137
CRD_DIFF_CONFIG := crd-diff-config.yaml
138+
138139
verify-crd-compatibility: $(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+
@if git show ${CRD_DIFF_ORIGINAL_REF}:config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml > /dev/null 2>&1; then \
141+
echo "Running CRD diff..."; \
142+
$(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}; \
143+
else \
144+
echo "Skipping CRD diff: CRD does not exist in ${CRD_DIFF_ORIGINAL_REF}"; \
145+
fi
140146

141147
.PHONY: lint
142148
lint: $(GOLANGCI_LINT) ## Run golangci linter.

0 commit comments

Comments
 (0)