mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 21:50:05 +00:00
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:
@@ -220,4 +220,35 @@ kube::util::analytics-link() {
|
||||
echo "[]()"
|
||||
}
|
||||
|
||||
# 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
|
||||
|
Reference in New Issue
Block a user