Fix tooling for apis/experimental's new home

* fix package name
* add a script to auto-gofmt everything, useful after grep/sed incantations
* update conversion/deep copy generation
* doc update
This commit is contained in:
Daniel Smith
2015-09-09 16:01:08 -07:00
parent 4c2adabf42
commit 7a0fc719fb
13 changed files with 203 additions and 70 deletions

View File

@@ -220,4 +220,35 @@ kube::util::analytics-link() {
echo "[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/${path}?pixel)]()"
}
# Takes a group/version and returns the path to its location on disk, sans
# "pkg". E.g.:
# * default behavior: experimental/v1 -> apis/experimental/v1
# * legacy behavior: api/v1 -> api/v1
# * Special handling for only a group: experimental -> apis/experimental
# * Special handling for only "api" group: api -> api
# * Very special handling for "v1": v1 -> api/v1
kube::util::group-version-to-pkg-path() {
local group_version="$1"
# Special cases first.
# TODO(lavalamp): Simplify this by moving pkg/api/v1 and splitting pkg/api,
# moving the results to pkg/apis/api.
case "${group_version}" in
v1)
echo "api/v1"
;;
api)
echo "api/v1"
;;
api/*)
echo "${group_version}"
;;
api/*)
echo "${group_version}"
;;
*)
echo "apis/${group_version}"
;;
esac
}
# ex: ts=2 sw=2 et filetype=sh