Skip to content

Commit 5ccde04

Browse files
committed
UPSTREAM: <carry>: Add manifests verify target
1 parent 287f4e2 commit 5ccde04

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

openshift/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ ifndef PROVIDER_VERSION
1212
$(error PROVIDER_VERSION is undefined)
1313
endif
1414

15+
.PHONY: verify
16+
verify: verify-ocp-manifests
17+
18+
# NOTE: This target extracts the provider version from the existing generated manifest
19+
# and uses it for regeneration. This means the version label itself is NOT verified,
20+
# only that the rest of the manifest structure is correct.
21+
.PHONY: verify-ocp-manifests
22+
verify-ocp-manifests:
23+
@echo "Extracting provider version from existing manifest..."
24+
$(eval PROVIDER_VERSION := $(shell yq eval '.metadata.labels."provider.cluster.x-k8s.io/version"' manifests/0000_30_cluster-api_04_cm.infrastructure-aws.yaml))
25+
@echo "Using PROVIDER_VERSION=$(PROVIDER_VERSION) for verification"
26+
@$(MAKE) ocp-manifests PROVIDER_VERSION=$(PROVIDER_VERSION)
27+
./verify-diff.sh
28+
1529
.PHONY: update-manifests-gen
1630
update-manifests-gen:
1731
cd tools && go get github.com/openshift/cluster-capi-operator/manifests-gen && go mod tidy && go mod vendor

openshift/verify-diff.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
FILE_DIFF=$(git ls-files -o --exclude-standard)
4+
5+
if [ "$FILE_DIFF" != "" ]; then
6+
echo "Found untracked files:"
7+
echo "$FILE_DIFF"
8+
exit 1
9+
fi
10+
11+
git diff --exit-code

0 commit comments

Comments
 (0)