*: add resource validation

Co-Authored-By: Yann Hamon <yann.hamon@contentful.com>
Co-Authored-By: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: paulfantom <pawel@krupa.net.pl>
This commit is contained in:
paulfantom
2021-01-29 12:17:19 +01:00
parent 40c1c7a190
commit 3670d5bf7d
7 changed files with 38 additions and 2 deletions

13
scripts/generate-schemas.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
DIR="crdschemas"
# Go to git repository root
cd ./$(git rev-parse --show-cdup)
rm -rf "$DIR"
mkdir "$DIR"
for crd in vendor/prometheus-operator/*-crd.libsonnet; do
jq '.spec.versions[0].schema.openAPIV3Schema' < "$crd" > "$DIR/$(basename "$crd" | sed 's/-crd.libsonnet/.json/')"
done