This commit is contained in:
parent
3f45023c55
commit
120ed80c97
1 changed files with 2 additions and 14 deletions
|
@ -94,11 +94,12 @@ jobs:
|
||||||
let ++NUM_OF_CRDS
|
let ++NUM_OF_CRDS
|
||||||
done < <(kubectl get crds 2>&1 | sed -n '/NAME/,$p' | tail -n +2)
|
done < <(kubectl get crds 2>&1 | sed -n '/NAME/,$p' | tail -n +2)
|
||||||
echo numCRDs: $NUM_OF_CRDS
|
echo numCRDs: $NUM_OF_CRDS
|
||||||
|
|
||||||
# Download converter script
|
# Download converter script
|
||||||
curl https://raw.githubusercontent.com/yannh/kubeconform/master/scripts/openapi2jsonschema.py --output $TMP_CRD_DIR/openapi2jsonschema.py 2>/dev/null
|
curl https://raw.githubusercontent.com/yannh/kubeconform/master/scripts/openapi2jsonschema.py --output $TMP_CRD_DIR/openapi2jsonschema.py 2>/dev/null
|
||||||
|
|
||||||
cd $SCHEMAS_DIR
|
|
||||||
# Convert crds to jsonSchema
|
# Convert crds to jsonSchema
|
||||||
|
cd $SCHEMAS_DIR
|
||||||
python3 $TMP_CRD_DIR/openapi2jsonschema.py $TMP_CRD_DIR/*.yaml
|
python3 $TMP_CRD_DIR/openapi2jsonschema.py $TMP_CRD_DIR/*.yaml
|
||||||
conversionResult=$?
|
conversionResult=$?
|
||||||
|
|
||||||
|
@ -125,19 +126,6 @@ jobs:
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CYAN='\033[0;36m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
if [ $conversionResult == 0 ]; then
|
|
||||||
printf "${GREEN}Successfully converted $NUM_OF_CRDS CRDs to JSON schema${NC}\n"
|
|
||||||
|
|
||||||
printf "\nTo validate a CR using various tools, run the relevant command:\n"
|
|
||||||
printf "\n- ${CYAN}datree:${NC}\n\$ datree test /path/to/file\n"
|
|
||||||
printf "\n- ${CYAN}kubeconform:${NC}\n\$ kubeconform -summary -output json -schema-location default -schema-location '$SCHEMAS_DIR/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json' /path/to/file\n"
|
|
||||||
printf "\n- ${CYAN}kubeval:${NC}\n\$ kubeval --additional-schema-locations file:\"$SCHEMAS_DIR\" /path/to/file\n\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf $TMP_CRD_DIR
|
rm -rf $TMP_CRD_DIR
|
||||||
|
|
||||||
- name: Deploy to Cloudflare R2
|
- name: Deploy to Cloudflare R2
|
||||||
|
|
Loading…
Reference in a new issue