mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #14392 from caesarxuchao/fix-swagger-docs-move-v1alpha1
simplify group-version-to-pkg-path
This commit is contained in:
commit
d6c3ac54b8
@ -243,11 +243,9 @@ kube::util::analytics-link() {
|
|||||||
# Takes a group/version and returns the path to its location on disk, sans
|
# Takes a group/version and returns the path to its location on disk, sans
|
||||||
# "pkg". E.g.:
|
# "pkg". E.g.:
|
||||||
# * default behavior: experimental/v1alpha1 -> apis/experimental/v1alpha1
|
# * default behavior: experimental/v1alpha1 -> apis/experimental/v1alpha1
|
||||||
# * legacy behavior: api/v1 -> api/v1
|
# * default behavior for only a group: experimental -> apis/experimental
|
||||||
# * Special handling for only a group: experimental -> apis/experimental
|
# * Special handling for empty group: v1 -> api/v1, unversioned -> api/unversioned
|
||||||
# * Special handling for only "api" group: api -> api
|
# * Very special handling for when both group and version are "": / -> api
|
||||||
# * Special handling for when both group and version are "": / -> api
|
|
||||||
# * Very special handling for "v1": v1 -> api/v1
|
|
||||||
kube::util::group-version-to-pkg-path() {
|
kube::util::group-version-to-pkg-path() {
|
||||||
local group_version="$1"
|
local group_version="$1"
|
||||||
# Special cases first.
|
# Special cases first.
|
||||||
@ -261,14 +259,8 @@ kube::util::group-version-to-pkg-path() {
|
|||||||
v1)
|
v1)
|
||||||
echo "api/v1"
|
echo "api/v1"
|
||||||
;;
|
;;
|
||||||
api)
|
unversioned)
|
||||||
echo "api/v1"
|
echo "api/unversioned"
|
||||||
;;
|
|
||||||
api/*)
|
|
||||||
echo "${group_version}"
|
|
||||||
;;
|
|
||||||
api/*)
|
|
||||||
echo "${group_version}"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "apis/${group_version}"
|
echo "apis/${group_version}"
|
||||||
|
@ -56,7 +56,7 @@ EOF
|
|||||||
mv "$TMPFILE" "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
mv "$TMPFILE" "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
||||||
}
|
}
|
||||||
|
|
||||||
GROUP_VERSIONS=(api/unversioned api/v1 experimental/v1alpha1)
|
GROUP_VERSIONS=(unversioned v1 experimental/v1alpha1)
|
||||||
# To avoid compile errors, remove the currently existing files.
|
# To avoid compile errors, remove the currently existing files.
|
||||||
for group_version in "${GROUP_VERSIONS[@]}"; do
|
for group_version in "${GROUP_VERSIONS[@]}"; do
|
||||||
rm -f "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
rm -f "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
||||||
|
Loading…
Reference in New Issue
Block a user