mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Speed up update-swagger-docs
Only build genswaggertypedocs once per run instead of per-package Speeds up the script from ~1:10 to ~0:18
This commit is contained in:
parent
f411880c73
commit
4d1b34a582
@ -51,7 +51,12 @@ kube::swagger::gen_types_swagger_doc() {
|
||||
EOF
|
||||
} > "${TMPFILE}"
|
||||
|
||||
go run cmd/genswaggertypedocs/swagger_type_docs.go -s \
|
||||
if ! which genswaggertypedocs >/dev/null; then
|
||||
# build if needed
|
||||
go install k8s.io/kubernetes/cmd/genswaggertypedocs
|
||||
fi
|
||||
|
||||
genswaggertypedocs -s \
|
||||
"${gv_dir}/types.go" \
|
||||
-f - \
|
||||
>> "${TMPFILE}"
|
||||
|
@ -35,6 +35,8 @@ IFS=" " read -r -a GROUP_VERSIONS <<< "meta/v1 meta/v1beta1 ${KUBE_AVAILABLE_GRO
|
||||
for group_version in "${GROUP_VERSIONS[@]}"; do
|
||||
rm -f "$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
||||
done
|
||||
# ensure we have the latest genswaggertypedocs built
|
||||
go install k8s.io/kubernetes/cmd/genswaggertypedocs
|
||||
for group_version in "${GROUP_VERSIONS[@]}"; do
|
||||
kube::swagger::gen_types_swagger_doc "${group_version}" "$(kube::util::group-version-to-pkg-path "${group_version}")"
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user