diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 662f8230603..7154e1e0082 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -243,11 +243,9 @@ kube::util::analytics-link() { # Takes a group/version and returns the path to its location on disk, sans # "pkg". E.g.: # * default behavior: experimental/v1alpha1 -> apis/experimental/v1alpha1 -# * legacy behavior: api/v1 -> api/v1 -# * Special handling for only a group: experimental -> apis/experimental -# * Special handling for only "api" group: api -> api -# * Special handling for when both group and version are "": / -> api -# * Very special handling for "v1": v1 -> api/v1 +# * default behavior for only a group: experimental -> apis/experimental +# * Special handling for empty group: v1 -> api/v1, unversioned -> api/unversioned +# * Very special handling for when both group and version are "": / -> api kube::util::group-version-to-pkg-path() { local group_version="$1" # Special cases first. @@ -261,14 +259,8 @@ kube::util::group-version-to-pkg-path() { v1) echo "api/v1" ;; - api) - echo "api/v1" - ;; - api/*) - echo "${group_version}" - ;; - api/*) - echo "${group_version}" + unversioned) + echo "api/unversioned" ;; *) echo "apis/${group_version}" diff --git a/hack/update-generated-swagger-docs.sh b/hack/update-generated-swagger-docs.sh index 9a9835c2c78..6a11fce7610 100755 --- a/hack/update-generated-swagger-docs.sh +++ b/hack/update-generated-swagger-docs.sh @@ -56,7 +56,7 @@ EOF 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. for group_version in "${GROUP_VERSIONS[@]}"; do rm -f "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"