Copy models-schema generator to sample-controller

Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 1d23ecbdde9caa688fddc17a3445c5fdd62e5c31
This commit is contained in:
Maciej Szulik
2026-01-26 13:07:16 +01:00
committed by Kubernetes Publisher
parent e1dc91e587
commit 911fcef705
2 changed files with 89 additions and 0 deletions
+13
View File
@@ -29,6 +29,19 @@ trap "cleanup" EXIT SIGINT
cleanup
# Ensure model-schema generator matches the version from
# k8s.io/kubernetes/pkg/generated/openapi/cmd/models-schema/main.go
echo "Ensuring models-schema is up-to-date"
K8S_MODELS_SCHEMA="${SCRIPT_ROOT}/../../../../pkg/generated/openapi/cmd/models-schema/main.go"
SAMPLE_CONTROLLER_MODELS_SCHEMA="${SCRIPT_ROOT}/pkg/generated/openapi/cmd/models-schema/main.go"
# these two files will only differ in the imported lines for generated openapi
if ! diff -I "k8s.io/kubernetes/pkg/generated/openapi" \
-I "k8s.io/sample-controller/pkg/generated/openapi" \
"${K8S_MODELS_SCHEMA}" "${SAMPLE_CONTROLLER_MODELS_SCHEMA}"; then
echo "${SAMPLE_CONTROLLER_MODELS_SCHEMA} is out of date. Compare changes with ${K8S_MODELS_SCHEMA}"
exit 1
fi
mkdir -p "${TMP_DIFFROOT}"
cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"