Merge pull request #12861 from subhamkrai/add-check-crd-csv

build: add check to validate crd in csv
This commit is contained in:
Travis Nielsen authored and GitHub committed 2023-09-06 10:32:30 -06:00
commit bf2211b22e
2 files changed
+15 -2

No files matched your search

+3 -2
View File
@@ -197,6 +197,7 @@ crds: $(CONTROLLER_GEN) $(YQ)
@echo Updating CRD manifests
@build/crds/build-crds.sh $(CONTROLLER_GEN) $(YQ)
@GOBIN=$(GOBIN) build/crds/generate-crd-docs.sh
@build/crds/validate-csv-crd-list.sh
gen-rbac: $(HELM) $(YQ) ## Generate RBAC from Helm charts
@# output only stdout to the file; stderr for debugging should keep going to stderr
@@ -219,13 +220,13 @@ check-helm-docs:
@git diff --exit-code || { \
echo "Please run 'make helm-docs' locally, commit the updated docs, and push the change. See https://rook.io/docs/rook/latest/Contributing/documentation/#making-docs" ; \
exit 2 ; \
};
};
check-docs:
@$(MAKE) docs
@git diff --exit-code || { \
echo "Please run 'make docs' locally, commit the updated docs, and push the change." ; \
exit 2 ; \
};
};
docs-preview: ## Preview the documentation through mkdocs
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
script_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)
list_of_crd_in_crd_yaml=$(grep -oE '[^ ]*\.ceph\.rook\.io' "${script_root}/deploy/examples/crds.yaml" | sort)
list_of_csv_in_csv_yaml=$(grep -oE '[^ ]*\.ceph\.rook\.io' "${script_root}/deploy/olm/assemble/metadata-common.yaml" | sort)
if [ "$list_of_crd_in_crd_yaml" != "$list_of_csv_in_csv_yaml" ]; then
echo "CRD list in crds.yaml file and metadata-common.yaml is different. Make sure to add crd in metadata-common.yaml."
echo -e "crd file list in crd.yaml:\n$list_of_crd_in_crd_yaml"
echo -e "crd file list in csv.yaml:\n$list_of_csv_in_csv_yaml"
fi