hack/update-generated-openapi.sh: regenerate kube spec
@@ -10,8 +10,7 @@ function codegen::join() { local IFS="$1"; shift; echo "$*"; }
ORIGIN_PREFIX="${OS_GO_PACKAGE}/"
-INPUT_DIRS=(
- # kube apis
+KUBE_INPUT_DIRS=(
$(
grep --color=never -rl '+k8s:openapi-gen=' vendor/k8s.io/kubernetes | \
xargs -n1 dirname | \
@@ -22,8 +21,8 @@ INPUT_DIRS=(
sed '/^k8s\.io\/kubernetes\/staging$/d' | \
sed 's,k8s\.io/kubernetes/staging/src/,,'
)
-
- # origin apis
+)
+ORIGIN_INPUT_DIRS=(
$(
grep --color=never -rl '+k8s:openapi-gen=' vendor/github.com/openshift/api | \
xargs -n1 dirname | \
@@ -32,16 +31,29 @@ INPUT_DIRS=(
)
)
-INPUT_DIRS=$(IFS=,; echo "${INPUT_DIRS[*]}")
+KUBE_INPUT_DIRS=$(IFS=,; echo "${KUBE_INPUT_DIRS[*]}")
+ORIGIN_INPUT_DIRS=$(IFS=,; echo "${ORIGIN_INPUT_DIRS[*]}")
-echo "Generating openapi"
+echo "Generating origin openapi"
${GOPATH}/bin/openapi-gen \
--logtostderr \
--build-tag=ignore_autogenerated_openshift \
--output-file-base zz_generated.openapi \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.txt \
--output-base="${GOPATH}/src" \
- --input-dirs "${INPUT_DIRS}" \
+ --input-dirs "${KUBE_INPUT_DIRS},${ORIGIN_INPUT_DIRS}" \
--output-package "${ORIGIN_PREFIX}pkg/openapi" \
--report-filename "${SCRIPT_ROOT}/hack/openapi-violation.list" \
"$@"
+
+echo "Generating kubernetes openapi"
+${GOPATH}/bin/openapi-gen \
+ --logtostderr \
+ --build-tag=ignore_autogenerated_openshift \
+ --output-file-base zz_generated.openapi \
+ --go-header-file ${SCRIPT_ROOT}/vendor/k8s.io/kubernetes/hack/boilerplate/boilerplate.generatego.txt \
+ --output-base="${GOPATH}/src" \
+ --input-dirs "${KUBE_INPUT_DIRS}" \
+ --output-package "${ORIGIN_PREFIX}/vendor/k8s.io/kubernetes/pkg/generated/openapi" \
+ --report-filename "${SCRIPT_ROOT}/vendor/k8s.io/kubernetes/hack/openapi-violation.list" \
+ "$@"
\ No newline at end of file
