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:
Jordan Liggitt
2020-08-02 00:10:01 -04:00
parent f411880c73
commit 4d1b34a582
2 changed files with 8 additions and 1 deletions

View File

@@ -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}"