Skip to content

Commit

Permalink
Enhance the makefile target check to skip CRDs that are new
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Jan 3, 2025
1 parent c4ee548 commit de2f314
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions catalogd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,16 @@ verify: tidy fmt vet generate ## Verify the current code generation and lint
git diff --exit-code

.PHONY: verify-crd-compatibility
CRD_DIFF_ORIGINAL_REF := main
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
CRD_DIFF_CONFIG := crd-diff-config.yaml
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
verify-crd-compatibility: $(CRD_DIFF)
$(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}
@if git rev-parse --verify ${CRD_DIFF_ORIGINAL_REF} >/dev/null 2>&1 && \
git show ${CRD_DIFF_ORIGINAL_REF}:${CRD_PATH} >/dev/null 2>&1; then \
echo "Running CRD diff for ${CRD_PATH}..."; \
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=${CRD_PATH}" ${CRD_DIFF_UPDATED_SOURCE}; \
else \
echo "Skipping CRD diff check: ${CRD_PATH} is new or ${CRD_DIFF_ORIGINAL_REF} does not exist."; \
fi

.PHONY: lint
lint: $(GOLANGCI_LINT) ## Run golangci linter.
Expand Down

0 comments on commit de2f314

Please sign in to comment.