Files
my-rook-config/build/crds/validate-csv-crd-list.sh
T
subhamkrai 1b652f8176 build: add check to validate crd in csv
In the past we had few cases where the new crd
was missed adding in metadata-common.yaml file.
So, now we'll check if crds.yaml and metadata-common.yaml
crd name are matching.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-09-06 19:37:25 +05:30

13 lines
655 B
Bash
Executable File

#!/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