refacotr update-api-reference-docs.sh

This commit is contained in:
Chao Xu
2016-02-08 19:11:06 -08:00
parent c70c7fde4d
commit 6aa23e4e49
5 changed files with 76 additions and 25 deletions

View File

@@ -297,4 +297,19 @@ kube::util::group-version-to-pkg-path() {
esac
}
# Takes a group/version and returns the swagger-spec file name.
# default behavior: extensions/v1beta1 -> extensions_v1beta1
# special case for v1: v1 -> v1
kube::util::gv-to-swagger-name() {
local group_version="$1"
case "${group_version}" in
v1)
echo "v1"
;;
*)
echo "${group_version%/*}_${group_version#*/}"
;;
esac
}
# ex: ts=2 sw=2 et filetype=sh