Add check that pruning is enabled in CRDs
@@ -13,10 +13,21 @@ operator/v1alpha1/*.crd.yaml
quota/v1/*.crd.yaml
security/v1/*.crd.yaml
"
+FAILS=false
for f in $FILES
do
if [[ $(./_output/tools/bin/yq r $f spec.validation.openAPIV3Schema.properties.metadata.description) != "null" ]]; then
echo "Error: cannot have a metadata description in $f"
- exit 1
+ FAILS=true
+ fi
+
+ if [[ $(./_output/tools/bin/yq r $f spec.preserveUnknownField) == "null" ]]; then
+ echo "Error: pruning not enabled (spec.preserveUnknownField != false) in $f"
+ FAILS=true
fi
done
+
+if [ "$FAILS" = true ] ; then
+ exit 1
+fi
+
