Skip to content

Commit

Permalink
fixes crd validation precheck
Browse files Browse the repository at this point in the history
  • Loading branch information
yue9944882 committed Sep 9, 2020
1 parent a8139ed commit 45a9527
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client-java-contrib/cert-manager/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ docker run \
-v "$(pwd)":"$(pwd)" \
-ti \
--network host \
docker.pkg.github.com/kubernetes-client/java/crd-model-gen:v1.0.0 \
docker.pkg.github.com/kubernetes-client/java/crd-model-gen:v1.0.1 \
/generate.sh \
-u https://github.com/jetstack/cert-manager/releases/download/v0.16.1/cert-manager.crds.yaml \
-n io.cert-manager \
Expand Down
2 changes: 1 addition & 1 deletion client-java-contrib/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ kubectl get crd -o name \
echo "$L failed publishing openapi schema because it's attached non-structral-schema condition."
exit 1
fi
if [[ $(kubectl get $L -o jsonpath='{.preserveUnknownFields}') == "true" ]]; then
if [[ $(kubectl get $L -o jsonpath='{.spec.preserveUnknownFields}') == "true" ]]; then
echo "$L failed publishing openapi schema because it explicitly disabled unknown fields pruning."
exit 1
fi
Expand Down
6 changes: 2 additions & 4 deletions client-java-contrib/prometheus-operator/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
# This script generates the model classes from a released version of cert-manager CRDs
# under src/main/java/io/cert/manager/models.

# build the crdgen image which includes all the toolchains needed for code generation
docker build .. -t crdgen

# a crdgen container is run in a way that:
# 1. it has access to the docker daemon on the host so that it is able to create sibling container on the host
# 2. it runs on the host network so that it is able to communicate with the KinD cluster it launched on the host
Expand All @@ -28,7 +25,8 @@ docker run \
-v "$(pwd)":"$(pwd)" \
-ti \
--network host \
crdgen /generate.sh \
docker.pkg.github.com/kubernetes-client/java/crd-model-gen:v1.0.1 \
/generate.sh \
-u https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.38.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml \
-u https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.38.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml \
-u https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.38.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml \
Expand Down

0 comments on commit 45a9527

Please sign in to comment.