Skip to content

Commit c5e9a17

Browse files
[Monorepo] Fix make verify-crd-compatibility for catalogd (#1668)
The `verify-crd-compatibility` check needs to be executed from the root directory; otherwise, it fails to correctly resolve commit SHAs for comparison. To address this, we have combined the checks for both CRDs into a single verification step, ensuring correctness while eliminating duplicate file references.
1 parent 10e2754 commit c5e9a17

File tree

5 files changed

+9
-143
lines changed

5 files changed

+9
-143
lines changed

.github/workflows/catalogd-crd-diff.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/crd-diff.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ jobs:
1414
go-version-file: go.mod
1515

1616
- name: Run make verify-crd-compatibility
17-
run: make verify-crd-compatibility CRD_DIFF_ORIGINAL_REF=${{ github.event.pull_request.base.sha }} CRD_DIFF_UPDATED_SOURCE="git://${{ github.event.pull_request.head.sha }}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml"
18-
17+
run: |
18+
make verify-crd-compatibility \
19+
CRD_DIFF_ORIGINAL_REF=${{ github.event.pull_request.base.sha }} \
20+
CRD_DIFF_UPDATED_SOURCE="git://${{ github.event.pull_request.head.sha }}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml" \
21+
CATALOGD_CRD_DIFF_UPDATED_SOURCE="git://${{ github.event.pull_request.head.sha }}?path=catalogd/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,13 @@ bingo-upgrade: $(BINGO) #EXHELP Upgrade tools
142142
.PHONY: verify-crd-compatibility
143143
CRD_DIFF_ORIGINAL_REF := main
144144
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
145+
CATALOGD_CRD_DIFF_UPDATED_SOURCE := file://catalogd/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
145146
CRD_DIFF_CONFIG := crd-diff-config.yaml
147+
146148
verify-crd-compatibility: $(CRD_DIFF) manifests
147149
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml" ${CRD_DIFF_UPDATED_SOURCE}
150+
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=catalogd/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml" ${CATALOGD_CRD_DIFF_UPDATED_SOURCE}
151+
148152

149153
.PHONY: test
150154
test: manifests generate fmt vet test-unit test-e2e #HELP Run all tests.

catalogd/Makefile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,6 @@ e2e: run image-registry test-e2e kind-cluster-cleanup ## Run e2e test suite on l
8888
image-registry: ## Setup in-cluster image registry
8989
./test/tools/imageregistry/registry.sh $(ISSUER_KIND) $(ISSUER_NAME)
9090

91-
.PHONY: verify-crd-compatibility
92-
CRD_DIFF_ORIGINAL_REF := main
93-
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
94-
CRD_DIFF_CONFIG := crd-diff-config.yaml
95-
verify-crd-compatibility: $(CRD_DIFF)
96-
@if git show ${CRD_DIFF_ORIGINAL_REF}:config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml > /dev/null 2>&1; then \
97-
echo "Running CRD diff..."; \
98-
$(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}; \
99-
else \
100-
echo "Skipping CRD diff: CRD does not exist in ${CRD_DIFF_ORIGINAL_REF}"; \
101-
fi
102-
103-
10491
## image-registry target has to come after run-latest-release,
10592
## because the image-registry depends on the olm-ca issuer.
10693
.PHONY: test-upgrade-e2e

catalogd/crd-diff-config.yaml

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)