From 3e39b4615484f54b8b5174d451e78028a831e20f Mon Sep 17 00:00:00 2001 From: yue9944882 <291271447@qq.com> Date: Mon, 4 Apr 2022 01:00:29 +0800 Subject: [PATCH] revert v2 path Signed-off-by: yue9944882 <291271447@qq.com> --- Makefile | 8 ++++---- {v2/cmd => cmd}/apiserver-boot/main.go | 12 ++++++------ {v2/pkg => pkg}/boot/build/build.go | 0 {v2/pkg => pkg}/boot/build/build_container.go | 2 +- {v2/pkg => pkg}/boot/build/build_executables.go | 0 {v2/pkg => pkg}/boot/build/build_resource_config.go | 2 +- {v2/pkg => pkg}/boot/build/docs.go | 0 {v2/pkg => pkg}/boot/build/util.go | 0 {v2/pkg => pkg}/boot/create/create.go | 0 {v2/pkg => pkg}/boot/create/group.go | 2 +- {v2/pkg => pkg}/boot/create/resource.go | 2 +- {v2/pkg => pkg}/boot/create/subresource.go | 2 +- {v2/pkg => pkg}/boot/create/util.go | 2 +- {v2/pkg => pkg}/boot/create/version.go | 2 +- {v2/pkg => pkg}/boot/init_repo/init.go | 0 {v2/pkg => pkg}/boot/init_repo/repo.go | 2 +- {v2/pkg => pkg}/boot/init_repo/template.go | 0 {v2/pkg => pkg}/boot/init_repo/templates/api.doc.tpl | 0 .../boot/init_repo/templates/apiserver.tpl | 0 {v2/pkg => pkg}/boot/init_repo/templates/go.mod.tpl | 0 .../boot/init_repo/templates/package.doc.tpl | 0 {v2/pkg => pkg}/boot/run/in_cluster.go | 4 ++-- {v2/pkg => pkg}/boot/run/local.go | 4 ++-- {v2/pkg => pkg}/boot/run/run.go | 0 {v2/pkg => pkg}/boot/show/cmd.go | 0 {v2/pkg => pkg}/boot/show/cmd_apiserver.go | 2 +- {v2/pkg => pkg}/boot/show/cmd_resource.go | 2 +- {v2/pkg => pkg}/boot/util/repo.go | 0 {v2/pkg => pkg}/boot/util/untar.go | 0 {v2/pkg => pkg}/boot/util/util.go | 0 {v2/pkg => pkg}/boot/util/x509.go | 0 {v2/pkg => pkg}/boot/version/version.go | 0 {v2/pkg => pkg}/utils/portforward.go | 0 {v2/pkg => pkg}/utils/prefixwriter.go | 0 34 files changed, 24 insertions(+), 24 deletions(-) rename {v2/cmd => cmd}/apiserver-boot/main.go (87%) rename {v2/pkg => pkg}/boot/build/build.go (100%) rename {v2/pkg => pkg}/boot/build/build_container.go (98%) rename {v2/pkg => pkg}/boot/build/build_executables.go (100%) rename {v2/pkg => pkg}/boot/build/build_resource_config.go (99%) rename {v2/pkg => pkg}/boot/build/docs.go (100%) rename {v2/pkg => pkg}/boot/build/util.go (100%) rename {v2/pkg => pkg}/boot/create/create.go (100%) rename {v2/pkg => pkg}/boot/create/group.go (97%) rename {v2/pkg => pkg}/boot/create/resource.go (99%) rename {v2/pkg => pkg}/boot/create/subresource.go (99%) rename {v2/pkg => pkg}/boot/create/util.go (98%) rename {v2/pkg => pkg}/boot/create/version.go (98%) rename {v2/pkg => pkg}/boot/init_repo/init.go (100%) rename {v2/pkg => pkg}/boot/init_repo/repo.go (98%) rename {v2/pkg => pkg}/boot/init_repo/template.go (100%) rename {v2/pkg => pkg}/boot/init_repo/templates/api.doc.tpl (100%) rename {v2/pkg => pkg}/boot/init_repo/templates/apiserver.tpl (100%) rename {v2/pkg => pkg}/boot/init_repo/templates/go.mod.tpl (100%) rename {v2/pkg => pkg}/boot/init_repo/templates/package.doc.tpl (100%) rename {v2/pkg => pkg}/boot/run/in_cluster.go (95%) rename {v2/pkg => pkg}/boot/run/local.go (98%) rename {v2/pkg => pkg}/boot/run/run.go (100%) rename {v2/pkg => pkg}/boot/show/cmd.go (100%) rename {v2/pkg => pkg}/boot/show/cmd_apiserver.go (99%) rename {v2/pkg => pkg}/boot/show/cmd_resource.go (99%) rename {v2/pkg => pkg}/boot/util/repo.go (100%) rename {v2/pkg => pkg}/boot/util/untar.go (100%) rename {v2/pkg => pkg}/boot/util/util.go (100%) rename {v2/pkg => pkg}/boot/util/x509.go (100%) rename {v2/pkg => pkg}/boot/version/version.go (100%) rename {v2/pkg => pkg}/utils/portforward.go (100%) rename {v2/pkg => pkg}/utils/prefixwriter.go (100%) diff --git a/Makefile b/Makefile index 98897a7f91..e01871d767 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ default: install .PHONY: test test: - go test ./v2/... + go test ./cmd/... ./pkg/... .PHONY: install install: build @@ -38,7 +38,7 @@ install: build @echo "GOOS: $(GOOS)" @echo "GOARCH: $(GOARCH)" @echo "ARCH: $(ARCH)" - go install ./v2/cmd/apiserver-boot + go install ./cmd/apiserver-boot .PHONY: clean clean: @@ -47,7 +47,7 @@ clean: .PHONY: build build: clean ## Create release artefacts for darwin:amd64, linux:amd64 and windows:amd64. Requires etcd, glide, hg. mkdir -p bin - go build -o bin/apiserver-boot ./v2/cmd/apiserver-boot + go build -o bin/apiserver-boot ./cmd/apiserver-boot release-binary: mkdir -p bin @@ -59,6 +59,6 @@ release-binary: -X 'sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.apiserverBuilderVersion=${VERSION}' \ -X 'sigs.k8s.io/apiserver-builder-alpha/cmd/apiserver-boot/boot/version.gitCommit=${COMMIT}' \ " \ - -o bin/apiserver-boot ./v2/cmd/apiserver-boot + -o bin/apiserver-boot ./cmd/apiserver-boot tar czvf apiserver-boot-${GOOS}-${GOARCH}.tar.gz bin/apiserver-boot diff --git a/v2/cmd/apiserver-boot/main.go b/cmd/apiserver-boot/main.go similarity index 87% rename from v2/cmd/apiserver-boot/main.go rename to cmd/apiserver-boot/main.go index 59ce7512b3..8d2128fbe6 100644 --- a/v2/cmd/apiserver-boot/main.go +++ b/cmd/apiserver-boot/main.go @@ -19,12 +19,12 @@ package main import ( "github.com/spf13/cobra" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/build" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/create" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/init_repo" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/run" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/show" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/version" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/build" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/create" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/init_repo" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/run" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/show" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/version" ) func main() { diff --git a/v2/pkg/boot/build/build.go b/pkg/boot/build/build.go similarity index 100% rename from v2/pkg/boot/build/build.go rename to pkg/boot/build/build.go diff --git a/v2/pkg/boot/build/build_container.go b/pkg/boot/build/build_container.go similarity index 98% rename from v2/pkg/boot/build/build_container.go rename to pkg/boot/build/build_container.go index d91a39ecf9..c009549ca5 100644 --- a/v2/pkg/boot/build/build_container.go +++ b/pkg/boot/build/build_container.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" "io/ioutil" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) var Image string diff --git a/v2/pkg/boot/build/build_executables.go b/pkg/boot/build/build_executables.go similarity index 100% rename from v2/pkg/boot/build/build_executables.go rename to pkg/boot/build/build_executables.go diff --git a/v2/pkg/boot/build/build_resource_config.go b/pkg/boot/build/build_resource_config.go similarity index 99% rename from v2/pkg/boot/build/build_resource_config.go rename to pkg/boot/build/build_resource_config.go index c1dfd004d7..b166f7486b 100644 --- a/v2/pkg/boot/build/build_resource_config.go +++ b/pkg/boot/build/build_resource_config.go @@ -31,7 +31,7 @@ import ( "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) var Name, Namespace string diff --git a/v2/pkg/boot/build/docs.go b/pkg/boot/build/docs.go similarity index 100% rename from v2/pkg/boot/build/docs.go rename to pkg/boot/build/docs.go diff --git a/v2/pkg/boot/build/util.go b/pkg/boot/build/util.go similarity index 100% rename from v2/pkg/boot/build/util.go rename to pkg/boot/build/util.go diff --git a/v2/pkg/boot/create/create.go b/pkg/boot/create/create.go similarity index 100% rename from v2/pkg/boot/create/create.go rename to pkg/boot/create/create.go diff --git a/v2/pkg/boot/create/group.go b/pkg/boot/create/group.go similarity index 97% rename from v2/pkg/boot/create/group.go rename to pkg/boot/create/group.go index 2e04d5b844..abdc9caf3f 100644 --- a/v2/pkg/boot/create/group.go +++ b/pkg/boot/create/group.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) var createGroupCmd = &cobra.Command{ diff --git a/v2/pkg/boot/create/resource.go b/pkg/boot/create/resource.go similarity index 99% rename from v2/pkg/boot/create/resource.go rename to pkg/boot/create/resource.go index c4389ed008..c10bb39e8d 100644 --- a/v2/pkg/boot/create/resource.go +++ b/pkg/boot/create/resource.go @@ -27,7 +27,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" config "sigs.k8s.io/kubebuilder/v3/pkg/config/v3" "sigs.k8s.io/kubebuilder/v3/pkg/machinery" "sigs.k8s.io/kubebuilder/v3/pkg/model/resource" diff --git a/v2/pkg/boot/create/subresource.go b/pkg/boot/create/subresource.go similarity index 99% rename from v2/pkg/boot/create/subresource.go rename to pkg/boot/create/subresource.go index edf660cb09..16a65d2975 100644 --- a/v2/pkg/boot/create/subresource.go +++ b/pkg/boot/create/subresource.go @@ -27,7 +27,7 @@ import ( "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) var subresourceName string diff --git a/v2/pkg/boot/create/util.go b/pkg/boot/create/util.go similarity index 98% rename from v2/pkg/boot/create/util.go rename to pkg/boot/create/util.go index 6ba266634d..91210234d4 100644 --- a/v2/pkg/boot/create/util.go +++ b/pkg/boot/create/util.go @@ -29,7 +29,7 @@ import ( "github.com/spf13/cobra" utilvalidation "k8s.io/apimachinery/pkg/util/validation" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) func ValidateResourceFlags() { diff --git a/v2/pkg/boot/create/version.go b/pkg/boot/create/version.go similarity index 98% rename from v2/pkg/boot/create/version.go rename to pkg/boot/create/version.go index feaa4e3fd5..f5146297dc 100644 --- a/v2/pkg/boot/create/version.go +++ b/pkg/boot/create/version.go @@ -24,7 +24,7 @@ import ( "github.com/spf13/cobra" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) var versionName string diff --git a/v2/pkg/boot/init_repo/init.go b/pkg/boot/init_repo/init.go similarity index 100% rename from v2/pkg/boot/init_repo/init.go rename to pkg/boot/init_repo/init.go diff --git a/v2/pkg/boot/init_repo/repo.go b/pkg/boot/init_repo/repo.go similarity index 98% rename from v2/pkg/boot/init_repo/repo.go rename to pkg/boot/init_repo/repo.go index 6cc85fe4f5..e6ae07732b 100644 --- a/v2/pkg/boot/init_repo/repo.go +++ b/pkg/boot/init_repo/repo.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" config "sigs.k8s.io/kubebuilder/v3/pkg/config/v3" "sigs.k8s.io/kubebuilder/v3/pkg/machinery" "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds" diff --git a/v2/pkg/boot/init_repo/template.go b/pkg/boot/init_repo/template.go similarity index 100% rename from v2/pkg/boot/init_repo/template.go rename to pkg/boot/init_repo/template.go diff --git a/v2/pkg/boot/init_repo/templates/api.doc.tpl b/pkg/boot/init_repo/templates/api.doc.tpl similarity index 100% rename from v2/pkg/boot/init_repo/templates/api.doc.tpl rename to pkg/boot/init_repo/templates/api.doc.tpl diff --git a/v2/pkg/boot/init_repo/templates/apiserver.tpl b/pkg/boot/init_repo/templates/apiserver.tpl similarity index 100% rename from v2/pkg/boot/init_repo/templates/apiserver.tpl rename to pkg/boot/init_repo/templates/apiserver.tpl diff --git a/v2/pkg/boot/init_repo/templates/go.mod.tpl b/pkg/boot/init_repo/templates/go.mod.tpl similarity index 100% rename from v2/pkg/boot/init_repo/templates/go.mod.tpl rename to pkg/boot/init_repo/templates/go.mod.tpl diff --git a/v2/pkg/boot/init_repo/templates/package.doc.tpl b/pkg/boot/init_repo/templates/package.doc.tpl similarity index 100% rename from v2/pkg/boot/init_repo/templates/package.doc.tpl rename to pkg/boot/init_repo/templates/package.doc.tpl diff --git a/v2/pkg/boot/run/in_cluster.go b/pkg/boot/run/in_cluster.go similarity index 95% rename from v2/pkg/boot/run/in_cluster.go rename to pkg/boot/run/in_cluster.go index 4cf7575376..a8526cad43 100644 --- a/v2/pkg/boot/run/in_cluster.go +++ b/pkg/boot/run/in_cluster.go @@ -21,8 +21,8 @@ import ( "github.com/spf13/cobra" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/build" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/build" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) var runInClusterCmd = &cobra.Command{ diff --git a/v2/pkg/boot/run/local.go b/pkg/boot/run/local.go similarity index 98% rename from v2/pkg/boot/run/local.go rename to pkg/boot/run/local.go index 925f8e7f03..d602c54815 100644 --- a/v2/pkg/boot/run/local.go +++ b/pkg/boot/run/local.go @@ -29,8 +29,8 @@ import ( "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog/v2" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/build" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/boot/util" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/build" + "sigs.k8s.io/apiserver-builder-alpha/pkg/boot/util" ) var localCmd = &cobra.Command{ diff --git a/v2/pkg/boot/run/run.go b/pkg/boot/run/run.go similarity index 100% rename from v2/pkg/boot/run/run.go rename to pkg/boot/run/run.go diff --git a/v2/pkg/boot/show/cmd.go b/pkg/boot/show/cmd.go similarity index 100% rename from v2/pkg/boot/show/cmd.go rename to pkg/boot/show/cmd.go diff --git a/v2/pkg/boot/show/cmd_apiserver.go b/pkg/boot/show/cmd_apiserver.go similarity index 99% rename from v2/pkg/boot/show/cmd_apiserver.go rename to pkg/boot/show/cmd_apiserver.go index a722973373..2c1af910ae 100644 --- a/v2/pkg/boot/show/cmd_apiserver.go +++ b/pkg/boot/show/cmd_apiserver.go @@ -14,7 +14,7 @@ import ( "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/utils" + "sigs.k8s.io/apiserver-builder-alpha/pkg/utils" ) var showApiserverCmd = &cobra.Command{ diff --git a/v2/pkg/boot/show/cmd_resource.go b/pkg/boot/show/cmd_resource.go similarity index 99% rename from v2/pkg/boot/show/cmd_resource.go rename to pkg/boot/show/cmd_resource.go index cc49503931..97bdd62e34 100644 --- a/v2/pkg/boot/show/cmd_resource.go +++ b/pkg/boot/show/cmd_resource.go @@ -20,7 +20,7 @@ import ( "k8s.io/client-go/kubernetes" apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" - "sigs.k8s.io/apiserver-builder-alpha/v2/pkg/utils" + "sigs.k8s.io/apiserver-builder-alpha/pkg/utils" ) var showResourceCmd = &cobra.Command{ diff --git a/v2/pkg/boot/util/repo.go b/pkg/boot/util/repo.go similarity index 100% rename from v2/pkg/boot/util/repo.go rename to pkg/boot/util/repo.go diff --git a/v2/pkg/boot/util/untar.go b/pkg/boot/util/untar.go similarity index 100% rename from v2/pkg/boot/util/untar.go rename to pkg/boot/util/untar.go diff --git a/v2/pkg/boot/util/util.go b/pkg/boot/util/util.go similarity index 100% rename from v2/pkg/boot/util/util.go rename to pkg/boot/util/util.go diff --git a/v2/pkg/boot/util/x509.go b/pkg/boot/util/x509.go similarity index 100% rename from v2/pkg/boot/util/x509.go rename to pkg/boot/util/x509.go diff --git a/v2/pkg/boot/version/version.go b/pkg/boot/version/version.go similarity index 100% rename from v2/pkg/boot/version/version.go rename to pkg/boot/version/version.go diff --git a/v2/pkg/utils/portforward.go b/pkg/utils/portforward.go similarity index 100% rename from v2/pkg/utils/portforward.go rename to pkg/utils/portforward.go diff --git a/v2/pkg/utils/prefixwriter.go b/pkg/utils/prefixwriter.go similarity index 100% rename from v2/pkg/utils/prefixwriter.go rename to pkg/utils/prefixwriter.go