Make update-codegen swagger work on gengo/v2

This commit is contained in:
Tim Hockin 2023-12-24 15:01:18 -08:00
parent 8420278c7f
commit b5b8c9d869
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -322,14 +322,14 @@ kube::util::group-version-to-pkg-path() {
# Change "foo.bar.k8s.io/v1" -> "foo/v1" notation. # Change "foo.bar.k8s.io/v1" -> "foo/v1" notation.
local simple_gv="${group_version/.*k8s.io/}" local simple_gv="${group_version/.*k8s.io/}"
if [[ "${api}" = "${simple_gv}" ]]; then if [[ "${api}" = "${simple_gv}" ]]; then
echo "vendor/k8s.io/api/${simple_gv}" echo "staging/src/k8s.io/api/${simple_gv}"
return return
fi fi
done done
# "v1" is the API GroupVersion # "v1" is the API GroupVersion
if [[ "${group_version}" == "v1" ]]; then if [[ "${group_version}" == "v1" ]]; then
echo "vendor/k8s.io/api/core/v1" echo "staging/src/k8s.io/api/core/v1"
return return
fi fi
@ -342,13 +342,13 @@ kube::util::group-version-to-pkg-path() {
echo "pkg/apis/core" echo "pkg/apis/core"
;; ;;
meta/v1) meta/v1)
echo "vendor/k8s.io/apimachinery/pkg/apis/meta/v1" echo "staging/src/k8s.io/apimachinery/pkg/apis/meta/v1"
;; ;;
meta/v1beta1) meta/v1beta1)
echo "vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1" echo "staging/src/k8s.io/apimachinery/pkg/apis/meta/v1beta1"
;; ;;
internal.apiserver.k8s.io/v1alpha1) internal.apiserver.k8s.io/v1alpha1)
echo "vendor/k8s.io/api/apiserverinternal/v1alpha1" echo "staging/src/k8s.io/api/apiserverinternal/v1alpha1"
;; ;;
*.k8s.io) *.k8s.io)
echo "pkg/apis/${group_version%.*k8s.io}" echo "pkg/apis/${group_version%.*k8s.io}"

View File

@ -247,7 +247,7 @@ EOF
# first in the case of regenerating everything. # first in the case of regenerating everything.
function codegen::swagger() { function codegen::swagger() {
# Build the tool # Build the tool
GO111MODULE=on GOPROXY=off go install \ GOPROXY=off go install \
./cmd/genswaggertypedocs ./cmd/genswaggertypedocs
local group_versions=() local group_versions=()