From b9f05dd357d9dc3bfbc22844840850ee110d6da6 Mon Sep 17 00:00:00 2001 From: monopole Date: Thu, 4 Feb 2021 08:35:01 -0800 Subject: [PATCH] Expose some top level kustomize commands. The PR exposes some of the top level kustomize commands (especially `build`) for reuse in other command line tools (expecially `kubectl`, see #1500). This PR represents option 3 from the following list of ways this exposure could be arranged. 1. Expose the commands in the `api` module. ``` REPO/api/go.mod REPO/api/builtins REPO/api/commands <- new REPO/api/... ``` Disadvantage: This would make `api` module depend on cobra. That's bad for clients that want to depend on the api, but want to write their own commands at their own version of cobra. The `api` module shouldn't depend on UX libraries like cobra. 2. Expose the commands in their own `commands` module. They'd appear alongside `api`, e.g. ` ``` REPO/api/go.mod REPO/api/builtins REPO/api/... REPO/commands/go.mod REPO/commands/build REPO/commands/edit REPO/commands/... ``` Advantage: The commands would be consumed by the kustomize binary and the kubectl binary in the same way. Disadvantage: The kustomize binary module and the commands module could evolve separately with their own version numbers, creating confusion. 3. Expose the commands in the existing `kustomize` module ``` REPO/api/go.mod REPO/api/builtins REPO/api/... REPO/kustomize/go.mod REPO/kustomize/main.go REPO/kustomize/commands/build REPO/kustomize/commands/edit REPO/kustomize/commands/... ``` Outside users, e.g. kubectl, could then ``` import sigs.k8s.io/kustomize/kustomize/v3/commands/build ``` and hopefully still get the `main` package as they do now via: ``` go get sigs.k8s.io/kustomize/kustomize/v3 ``` Advantage: 1) The kustomize binary ships at the same version as the commands - which makes sense as the binary's _version_ refers to how the CLI operates (command names, flags, etc.). This makes it easy to related the version of a kustomize binary with the version of commands running in some other CLI binary. 2) The path to the kustomize binary doesn't change. Disadvantage: It's an atypical Go module arrangement. Usually `main` packages live as leaves under a directory called `cmd` inside a module, rather than at the _top_ of the module. This might cause some problems. If so, we can go with option 4. 4. Same as 3, but move `main.go` (the `main` package) down one step. ``` REPO/api/go.mod REPO/api/builtins REPO/api/... REPO/kustomize/go.mod REPO/kustomize/cmd/main.go REPO/kustomize/commands/build REPO/kustomize/commands/edit REPO/kustomize/commands/... ``` --- hack/imports.sh | 5 +++-- kustomize/{internal => }/commands/build/build.go | 4 ++-- .../{internal => }/commands/build/build_test.go | 0 .../{internal => }/commands/build/flagEnableKyaml.go | 0 .../commands/build/flagaddmanagedby.go | 1 - .../commands/build/flagallowresourceidchanges.go | 0 .../commands/build/flagenableplugins.go | 0 .../commands/build/flagloadrestrictor.go | 0 .../{internal => }/commands/build/reorderoutput.go | 0 .../commands/build/reorderoutput_string.go | 0 kustomize/{internal => }/commands/commands.go | 12 ++++++------ kustomize/{internal => }/commands/create/create.go | 4 ++-- .../{internal => }/commands/create/create_test.go | 2 +- .../{internal => }/commands/edit/add/addbase.go | 2 +- .../{internal => }/commands/edit/add/addbase_test.go | 4 ++-- .../{internal => }/commands/edit/add/addcomponent.go | 4 ++-- .../commands/edit/add/addcomponent_test.go | 2 +- .../{internal => }/commands/edit/add/addmetadata.go | 4 ++-- .../commands/edit/add/addmetadata_test.go | 4 ++-- .../{internal => }/commands/edit/add/addpatch.go | 2 +- .../commands/edit/add/addpatch_test.go | 2 +- .../{internal => }/commands/edit/add/addresource.go | 4 ++-- .../commands/edit/add/addresource_test.go | 2 +- .../commands/edit/add/addtransformer.go | 4 ++-- .../commands/edit/add/addtransformer_test.go | 4 ++-- kustomize/{internal => }/commands/edit/add/all.go | 0 .../{internal => }/commands/edit/add/configmap.go | 2 +- .../commands/edit/add/configmap_test.go | 0 .../{internal => }/commands/edit/add/flagsandargs.go | 2 +- .../commands/edit/add/flagsandargs_test.go | 0 kustomize/{internal => }/commands/edit/add/secret.go | 2 +- .../{internal => }/commands/edit/add/secret_test.go | 0 kustomize/{internal => }/commands/edit/all.go | 10 +++++----- kustomize/{internal => }/commands/edit/fix/fix.go | 2 +- .../{internal => }/commands/edit/fix/fix_test.go | 2 +- .../commands/edit/listbuiltin/listbuiltin.go | 0 kustomize/{internal => }/commands/edit/remove/all.go | 0 .../commands/edit/remove/removemetadata.go | 2 +- .../commands/edit/remove/removemetadata_test.go | 4 ++-- .../commands/edit/remove/removepatch.go | 2 +- .../commands/edit/remove/removepatch_test.go | 2 +- .../commands/edit/remove/removeresource.go | 2 +- .../commands/edit/remove/removeresource_test.go | 2 +- .../commands/edit/remove/removetransformer.go | 2 +- .../commands/edit/remove/removetransformer_test.go | 2 +- .../commands/edit/remove_test/removetest.go | 2 +- kustomize/{internal => }/commands/edit/set/all.go | 0 .../commands/edit/set/set_name_prefix.go | 2 +- .../commands/edit/set/set_name_prefix_test.go | 2 +- .../commands/edit/set/set_name_suffix.go | 2 +- .../commands/edit/set/set_name_suffix_test.go | 2 +- .../{internal => }/commands/edit/set/setimage.go | 2 +- .../commands/edit/set/setimage_test.go | 2 +- .../{internal => }/commands/edit/set/setlabel.go | 4 ++-- .../commands/edit/set/setlabel_test.go | 4 ++-- .../{internal => }/commands/edit/set/setnamespace.go | 2 +- .../commands/edit/set/setnamespace_test.go | 2 +- .../{internal => }/commands/edit/set/setreplicas.go | 2 +- .../commands/edit/set/setreplicas_test.go | 2 +- .../internal}/kustfile/kustomizationfile.go | 0 .../internal}/kustfile/kustomizationfile_test.go | 2 +- .../internal}/testutils/testutils.go | 0 .../commands => commands/internal}/util/util.go | 0 .../commands => commands/internal}/util/util_test.go | 0 .../{internal => }/commands/openapi/info/info.go | 0 kustomize/{internal => }/commands/openapi/openapi.go | 2 +- kustomize/{internal => }/commands/version/version.go | 0 kustomize/go.mod | 1 - kustomize/main.go | 2 +- 69 files changed, 70 insertions(+), 71 deletions(-) rename kustomize/{internal => }/commands/build/build.go (98%) rename kustomize/{internal => }/commands/build/build_test.go (100%) rename kustomize/{internal => }/commands/build/flagEnableKyaml.go (100%) rename kustomize/{internal => }/commands/build/flagaddmanagedby.go (99%) rename kustomize/{internal => }/commands/build/flagallowresourceidchanges.go (100%) rename kustomize/{internal => }/commands/build/flagenableplugins.go (100%) rename kustomize/{internal => }/commands/build/flagloadrestrictor.go (100%) rename kustomize/{internal => }/commands/build/reorderoutput.go (100%) rename kustomize/{internal => }/commands/build/reorderoutput_string.go (100%) rename kustomize/{internal => }/commands/commands.go (79%) rename kustomize/{internal => }/commands/create/create.go (97%) rename kustomize/{internal => }/commands/create/create_test.go (98%) rename kustomize/{internal => }/commands/edit/add/addbase.go (96%) rename kustomize/{internal => }/commands/edit/add/addbase_test.go (93%) rename kustomize/{internal => }/commands/edit/add/addcomponent.go (93%) rename kustomize/{internal => }/commands/edit/add/addcomponent_test.go (96%) rename kustomize/{internal => }/commands/edit/add/addmetadata.go (96%) rename kustomize/{internal => }/commands/edit/add/addmetadata_test.go (98%) rename kustomize/{internal => }/commands/edit/add/addpatch.go (97%) rename kustomize/{internal => }/commands/edit/add/addpatch_test.go (97%) rename kustomize/{internal => }/commands/edit/add/addresource.go (93%) rename kustomize/{internal => }/commands/edit/add/addresource_test.go (96%) rename kustomize/{internal => }/commands/edit/add/addtransformer.go (93%) rename kustomize/{internal => }/commands/edit/add/addtransformer_test.go (95%) rename kustomize/{internal => }/commands/edit/add/all.go (100%) rename kustomize/{internal => }/commands/edit/add/configmap.go (98%) rename kustomize/{internal => }/commands/edit/add/configmap_test.go (100%) rename kustomize/{internal => }/commands/edit/add/flagsandargs.go (98%) rename kustomize/{internal => }/commands/edit/add/flagsandargs_test.go (100%) rename kustomize/{internal => }/commands/edit/add/secret.go (98%) rename kustomize/{internal => }/commands/edit/add/secret_test.go (100%) rename kustomize/{internal => }/commands/edit/all.go (77%) rename kustomize/{internal => }/commands/edit/fix/fix.go (93%) rename kustomize/{internal => }/commands/edit/fix/fix_test.go (97%) rename kustomize/{internal => }/commands/edit/listbuiltin/listbuiltin.go (100%) rename kustomize/{internal => }/commands/edit/remove/all.go (100%) rename kustomize/{internal => }/commands/edit/remove/removemetadata.go (98%) rename kustomize/{internal => }/commands/edit/remove/removemetadata_test.go (98%) rename kustomize/{internal => }/commands/edit/remove/removepatch.go (97%) rename kustomize/{internal => }/commands/edit/remove/removepatch_test.go (98%) rename kustomize/{internal => }/commands/edit/remove/removeresource.go (97%) rename kustomize/{internal => }/commands/edit/remove/removeresource_test.go (96%) rename kustomize/{internal => }/commands/edit/remove/removetransformer.go (96%) rename kustomize/{internal => }/commands/edit/remove/removetransformer_test.go (96%) rename kustomize/{internal => }/commands/edit/remove_test/removetest.go (97%) rename kustomize/{internal => }/commands/edit/set/all.go (100%) rename kustomize/{internal => }/commands/edit/set/set_name_prefix.go (95%) rename kustomize/{internal => }/commands/edit/set/set_name_prefix_test.go (92%) rename kustomize/{internal => }/commands/edit/set/set_name_suffix.go (95%) rename kustomize/{internal => }/commands/edit/set/set_name_suffix_test.go (92%) rename kustomize/{internal => }/commands/edit/set/setimage.go (98%) rename kustomize/{internal => }/commands/edit/set/setimage_test.go (99%) rename kustomize/{internal => }/commands/edit/set/setlabel.go (94%) rename kustomize/{internal => }/commands/edit/set/setlabel_test.go (96%) rename kustomize/{internal => }/commands/edit/set/setnamespace.go (96%) rename kustomize/{internal => }/commands/edit/set/setnamespace_test.go (96%) rename kustomize/{internal => }/commands/edit/set/setreplicas.go (97%) rename kustomize/{internal => }/commands/edit/set/setreplicas_test.go (97%) rename kustomize/{internal/commands => commands/internal}/kustfile/kustomizationfile.go (100%) rename kustomize/{internal/commands => commands/internal}/kustfile/kustomizationfile_test.go (98%) rename kustomize/{internal/commands => commands/internal}/testutils/testutils.go (100%) rename kustomize/{internal/commands => commands/internal}/util/util.go (100%) rename kustomize/{internal/commands => commands/internal}/util/util_test.go (100%) rename kustomize/{internal => }/commands/openapi/info/info.go (100%) rename kustomize/{internal => }/commands/openapi/openapi.go (89%) rename kustomize/{internal => }/commands/version/version.go (100%) diff --git a/hack/imports.sh b/hack/imports.sh index cc2668f5a..f4a196409 100755 --- a/hack/imports.sh +++ b/hack/imports.sh @@ -1,5 +1,6 @@ for f in $(find $1 -name '*.go'); do echo $f - # go run go.coder.com/go-tools/cmd/goimports - ~/gopath/bin/goimports -w $f + # go get golang.org/x/tools/cmd/goimports + # {or} go run go.coder.com/go-tools/cmd/goimports + goimports -w $f done diff --git a/kustomize/internal/commands/build/build.go b/kustomize/commands/build/build.go similarity index 98% rename from kustomize/internal/commands/build/build.go rename to kustomize/commands/build/build.go index f2b50cfcf..99a797754 100644 --- a/kustomize/internal/commands/build/build.go +++ b/kustomize/commands/build/build.go @@ -54,10 +54,10 @@ https://github.com/hashicorp/go-getter#url-format ` // NewCmdBuild creates a new build command. -func NewCmdBuild(out io.Writer) *cobra.Command { +func NewCmdBuild(cmdName string, out io.Writer) *cobra.Command { var o Options cmd := &cobra.Command{ - Use: "build {path}", + Use: cmdName + " {path}", Short: "Print configuration per contents of " + konfig.DefaultKustomizationFileName(), Example: examples, diff --git a/kustomize/internal/commands/build/build_test.go b/kustomize/commands/build/build_test.go similarity index 100% rename from kustomize/internal/commands/build/build_test.go rename to kustomize/commands/build/build_test.go diff --git a/kustomize/internal/commands/build/flagEnableKyaml.go b/kustomize/commands/build/flagEnableKyaml.go similarity index 100% rename from kustomize/internal/commands/build/flagEnableKyaml.go rename to kustomize/commands/build/flagEnableKyaml.go diff --git a/kustomize/internal/commands/build/flagaddmanagedby.go b/kustomize/commands/build/flagaddmanagedby.go similarity index 99% rename from kustomize/internal/commands/build/flagaddmanagedby.go rename to kustomize/commands/build/flagaddmanagedby.go index 3d737f518..807d7ee64 100644 --- a/kustomize/internal/commands/build/flagaddmanagedby.go +++ b/kustomize/commands/build/flagaddmanagedby.go @@ -7,7 +7,6 @@ import ( "os" "github.com/spf13/pflag" - "sigs.k8s.io/kustomize/api/konfig" ) diff --git a/kustomize/internal/commands/build/flagallowresourceidchanges.go b/kustomize/commands/build/flagallowresourceidchanges.go similarity index 100% rename from kustomize/internal/commands/build/flagallowresourceidchanges.go rename to kustomize/commands/build/flagallowresourceidchanges.go diff --git a/kustomize/internal/commands/build/flagenableplugins.go b/kustomize/commands/build/flagenableplugins.go similarity index 100% rename from kustomize/internal/commands/build/flagenableplugins.go rename to kustomize/commands/build/flagenableplugins.go diff --git a/kustomize/internal/commands/build/flagloadrestrictor.go b/kustomize/commands/build/flagloadrestrictor.go similarity index 100% rename from kustomize/internal/commands/build/flagloadrestrictor.go rename to kustomize/commands/build/flagloadrestrictor.go diff --git a/kustomize/internal/commands/build/reorderoutput.go b/kustomize/commands/build/reorderoutput.go similarity index 100% rename from kustomize/internal/commands/build/reorderoutput.go rename to kustomize/commands/build/reorderoutput.go diff --git a/kustomize/internal/commands/build/reorderoutput_string.go b/kustomize/commands/build/reorderoutput_string.go similarity index 100% rename from kustomize/internal/commands/build/reorderoutput_string.go rename to kustomize/commands/build/reorderoutput_string.go diff --git a/kustomize/internal/commands/commands.go b/kustomize/commands/commands.go similarity index 79% rename from kustomize/internal/commands/commands.go rename to kustomize/commands/commands.go index 81e54ab0f..563c69a6c 100644 --- a/kustomize/internal/commands/commands.go +++ b/kustomize/commands/commands.go @@ -14,11 +14,11 @@ import ( "sigs.k8s.io/kustomize/api/provider" "sigs.k8s.io/kustomize/cmd/config/completion" "sigs.k8s.io/kustomize/cmd/config/configcobra" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/build" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/create" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/openapi" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/version" + "sigs.k8s.io/kustomize/kustomize/v3/commands/build" + "sigs.k8s.io/kustomize/kustomize/v3/commands/create" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit" + "sigs.k8s.io/kustomize/kustomize/v3/commands/openapi" + "sigs.k8s.io/kustomize/kustomize/v3/commands/version" ) // NewDefaultCommand returns the default (aka root) command for kustomize command. @@ -37,7 +37,7 @@ See https://sigs.k8s.io/kustomize pvd := provider.NewDefaultDepProvider() c.AddCommand( completion.NewCommand(), - build.NewCmdBuild(stdOut), + build.NewCmdBuild("build", stdOut), edit.NewCmdEdit( fSys, pvd.GetFieldValidator(), pvd.GetKunstructuredFactory()), create.NewCmdCreate(fSys, pvd.GetKunstructuredFactory()), diff --git a/kustomize/internal/commands/create/create.go b/kustomize/commands/create/create.go similarity index 97% rename from kustomize/internal/commands/create/create.go rename to kustomize/commands/create/create.go index 51871728b..6763f0871 100644 --- a/kustomize/internal/commands/create/create.go +++ b/kustomize/commands/create/create.go @@ -14,8 +14,8 @@ import ( "sigs.k8s.io/kustomize/api/ifc" "sigs.k8s.io/kustomize/api/konfig" "sigs.k8s.io/kustomize/api/loader" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/util" ) type createFlags struct { diff --git a/kustomize/internal/commands/create/create_test.go b/kustomize/commands/create/create_test.go similarity index 98% rename from kustomize/internal/commands/create/create_test.go rename to kustomize/commands/create/create_test.go index 5c9fcdc65..4b9f05897 100644 --- a/kustomize/internal/commands/create/create_test.go +++ b/kustomize/commands/create/create_test.go @@ -10,7 +10,7 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/provider" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) var factory = provider.NewDefaultDepProvider().GetKunstructuredFactory() diff --git a/kustomize/internal/commands/edit/add/addbase.go b/kustomize/commands/edit/add/addbase.go similarity index 96% rename from kustomize/internal/commands/edit/add/addbase.go rename to kustomize/commands/edit/add/addbase.go index 096d90ee9..486e7a1dc 100644 --- a/kustomize/internal/commands/edit/add/addbase.go +++ b/kustomize/commands/edit/add/addbase.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type addBaseOptions struct { diff --git a/kustomize/internal/commands/edit/add/addbase_test.go b/kustomize/commands/edit/add/addbase_test.go similarity index 93% rename from kustomize/internal/commands/edit/add/addbase_test.go rename to kustomize/commands/edit/add/addbase_test.go index ad52fa5de..f4d31c1cb 100644 --- a/kustomize/internal/commands/edit/add/addbase_test.go +++ b/kustomize/commands/edit/add/addbase_test.go @@ -8,8 +8,8 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/add/addcomponent.go b/kustomize/commands/edit/add/addcomponent.go similarity index 93% rename from kustomize/internal/commands/edit/add/addcomponent.go rename to kustomize/commands/edit/add/addcomponent.go index b0de4e863..1ebd8994d 100644 --- a/kustomize/internal/commands/edit/add/addcomponent.go +++ b/kustomize/commands/edit/add/addcomponent.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/loader" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/util" ) type addComponentOptions struct { diff --git a/kustomize/internal/commands/edit/add/addcomponent_test.go b/kustomize/commands/edit/add/addcomponent_test.go similarity index 96% rename from kustomize/internal/commands/edit/add/addcomponent_test.go rename to kustomize/commands/edit/add/addcomponent_test.go index 3f4c42fba..e883bb2fc 100644 --- a/kustomize/internal/commands/edit/add/addcomponent_test.go +++ b/kustomize/commands/edit/add/addcomponent_test.go @@ -8,7 +8,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/add/addmetadata.go b/kustomize/commands/edit/add/addmetadata.go similarity index 96% rename from kustomize/internal/commands/edit/add/addmetadata.go rename to kustomize/commands/edit/add/addmetadata.go index 6157782fa..275a8a9af 100644 --- a/kustomize/internal/commands/edit/add/addmetadata.go +++ b/kustomize/commands/edit/add/addmetadata.go @@ -10,8 +10,8 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/konfig" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/util" ) // kindOfAdd is the kind of metadata being added: label or annotation diff --git a/kustomize/internal/commands/edit/add/addmetadata_test.go b/kustomize/commands/edit/add/addmetadata_test.go similarity index 98% rename from kustomize/internal/commands/edit/add/addmetadata_test.go rename to kustomize/commands/edit/add/addmetadata_test.go index ae0dbe6b8..f3fb632e8 100644 --- a/kustomize/internal/commands/edit/add/addmetadata_test.go +++ b/kustomize/commands/edit/add/addmetadata_test.go @@ -10,8 +10,8 @@ import ( "sigs.k8s.io/kustomize/api/filesys" valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) func makeKustomization(t *testing.T) *types.Kustomization { diff --git a/kustomize/internal/commands/edit/add/addpatch.go b/kustomize/commands/edit/add/addpatch.go similarity index 97% rename from kustomize/internal/commands/edit/add/addpatch.go rename to kustomize/commands/edit/add/addpatch.go index 7d82a3c1c..9046f136e 100644 --- a/kustomize/internal/commands/edit/add/addpatch.go +++ b/kustomize/commands/edit/add/addpatch.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type addPatchOptions struct { diff --git a/kustomize/internal/commands/edit/add/addpatch_test.go b/kustomize/commands/edit/add/addpatch_test.go similarity index 97% rename from kustomize/internal/commands/edit/add/addpatch_test.go rename to kustomize/commands/edit/add/addpatch_test.go index 3e05301d8..4c7484510 100644 --- a/kustomize/internal/commands/edit/add/addpatch_test.go +++ b/kustomize/commands/edit/add/addpatch_test.go @@ -8,7 +8,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/add/addresource.go b/kustomize/commands/edit/add/addresource.go similarity index 93% rename from kustomize/internal/commands/edit/add/addresource.go rename to kustomize/commands/edit/add/addresource.go index 2060aadea..f783897a0 100644 --- a/kustomize/internal/commands/edit/add/addresource.go +++ b/kustomize/commands/edit/add/addresource.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/loader" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/util" ) type addResourceOptions struct { diff --git a/kustomize/internal/commands/edit/add/addresource_test.go b/kustomize/commands/edit/add/addresource_test.go similarity index 96% rename from kustomize/internal/commands/edit/add/addresource_test.go rename to kustomize/commands/edit/add/addresource_test.go index 3b1afc674..99e123e67 100644 --- a/kustomize/internal/commands/edit/add/addresource_test.go +++ b/kustomize/commands/edit/add/addresource_test.go @@ -8,7 +8,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/add/addtransformer.go b/kustomize/commands/edit/add/addtransformer.go similarity index 93% rename from kustomize/internal/commands/edit/add/addtransformer.go rename to kustomize/commands/edit/add/addtransformer.go index b9eb249e4..48c5aed04 100644 --- a/kustomize/internal/commands/edit/add/addtransformer.go +++ b/kustomize/commands/edit/add/addtransformer.go @@ -9,8 +9,8 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/util" ) type addTransformerOptions struct { diff --git a/kustomize/internal/commands/edit/add/addtransformer_test.go b/kustomize/commands/edit/add/addtransformer_test.go similarity index 95% rename from kustomize/internal/commands/edit/add/addtransformer_test.go rename to kustomize/commands/edit/add/addtransformer_test.go index d9e27a0f7..05e3a7e38 100644 --- a/kustomize/internal/commands/edit/add/addtransformer_test.go +++ b/kustomize/commands/edit/add/addtransformer_test.go @@ -9,8 +9,8 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/add/all.go b/kustomize/commands/edit/add/all.go similarity index 100% rename from kustomize/internal/commands/edit/add/all.go rename to kustomize/commands/edit/add/all.go diff --git a/kustomize/internal/commands/edit/add/configmap.go b/kustomize/commands/edit/add/configmap.go similarity index 98% rename from kustomize/internal/commands/edit/add/configmap.go rename to kustomize/commands/edit/add/configmap.go index 7e928fcac..778e57bc2 100644 --- a/kustomize/internal/commands/edit/add/configmap.go +++ b/kustomize/commands/edit/add/configmap.go @@ -8,7 +8,7 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/ifc" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) // newCmdAddConfigMap returns a new command. diff --git a/kustomize/internal/commands/edit/add/configmap_test.go b/kustomize/commands/edit/add/configmap_test.go similarity index 100% rename from kustomize/internal/commands/edit/add/configmap_test.go rename to kustomize/commands/edit/add/configmap_test.go diff --git a/kustomize/internal/commands/edit/add/flagsandargs.go b/kustomize/commands/edit/add/flagsandargs.go similarity index 98% rename from kustomize/internal/commands/edit/add/flagsandargs.go rename to kustomize/commands/edit/add/flagsandargs.go index 1a896e4ff..93e4ec788 100644 --- a/kustomize/internal/commands/edit/add/flagsandargs.go +++ b/kustomize/commands/edit/add/flagsandargs.go @@ -10,7 +10,7 @@ import ( "sigs.k8s.io/kustomize/api/types" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/util" ) // flagsAndArgs encapsulates the options for add secret/configmap commands. diff --git a/kustomize/internal/commands/edit/add/flagsandargs_test.go b/kustomize/commands/edit/add/flagsandargs_test.go similarity index 100% rename from kustomize/internal/commands/edit/add/flagsandargs_test.go rename to kustomize/commands/edit/add/flagsandargs_test.go diff --git a/kustomize/internal/commands/edit/add/secret.go b/kustomize/commands/edit/add/secret.go similarity index 98% rename from kustomize/internal/commands/edit/add/secret.go rename to kustomize/commands/edit/add/secret.go index 4fc93c616..c38666665 100644 --- a/kustomize/internal/commands/edit/add/secret.go +++ b/kustomize/commands/edit/add/secret.go @@ -8,7 +8,7 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/ifc" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) // newCmdAddSecret returns a new command. diff --git a/kustomize/internal/commands/edit/add/secret_test.go b/kustomize/commands/edit/add/secret_test.go similarity index 100% rename from kustomize/internal/commands/edit/add/secret_test.go rename to kustomize/commands/edit/add/secret_test.go diff --git a/kustomize/internal/commands/edit/all.go b/kustomize/commands/edit/all.go similarity index 77% rename from kustomize/internal/commands/edit/all.go rename to kustomize/commands/edit/all.go index c43a98cd4..e86ab75c7 100644 --- a/kustomize/internal/commands/edit/all.go +++ b/kustomize/commands/edit/all.go @@ -9,11 +9,11 @@ import ( "sigs.k8s.io/kustomize/api/ifc" "sigs.k8s.io/kustomize/api/kv" "sigs.k8s.io/kustomize/api/loader" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/add" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/fix" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/listbuiltin" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/remove" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/set" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit/add" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit/fix" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit/listbuiltin" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit/remove" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit/set" ) // NewCmdEdit returns an instance of 'edit' subcommand. diff --git a/kustomize/internal/commands/edit/fix/fix.go b/kustomize/commands/edit/fix/fix.go similarity index 93% rename from kustomize/internal/commands/edit/fix/fix.go rename to kustomize/commands/edit/fix/fix.go index 6600f7849..941f3de13 100644 --- a/kustomize/internal/commands/edit/fix/fix.go +++ b/kustomize/commands/edit/fix/fix.go @@ -6,7 +6,7 @@ package fix import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) // NewCmdFix returns an instance of 'fix' subcommand. diff --git a/kustomize/internal/commands/edit/fix/fix_test.go b/kustomize/commands/edit/fix/fix_test.go similarity index 97% rename from kustomize/internal/commands/edit/fix/fix_test.go rename to kustomize/commands/edit/fix/fix_test.go index 3c1b52210..dabf88257 100644 --- a/kustomize/internal/commands/edit/fix/fix_test.go +++ b/kustomize/commands/edit/fix/fix_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/go-cmp/cmp" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) func TestFix(t *testing.T) { diff --git a/kustomize/internal/commands/edit/listbuiltin/listbuiltin.go b/kustomize/commands/edit/listbuiltin/listbuiltin.go similarity index 100% rename from kustomize/internal/commands/edit/listbuiltin/listbuiltin.go rename to kustomize/commands/edit/listbuiltin/listbuiltin.go diff --git a/kustomize/internal/commands/edit/remove/all.go b/kustomize/commands/edit/remove/all.go similarity index 100% rename from kustomize/internal/commands/edit/remove/all.go rename to kustomize/commands/edit/remove/all.go diff --git a/kustomize/internal/commands/edit/remove/removemetadata.go b/kustomize/commands/edit/remove/removemetadata.go similarity index 98% rename from kustomize/internal/commands/edit/remove/removemetadata.go rename to kustomize/commands/edit/remove/removemetadata.go index 5a0048055..0a7721744 100644 --- a/kustomize/internal/commands/edit/remove/removemetadata.go +++ b/kustomize/commands/edit/remove/removemetadata.go @@ -11,7 +11,7 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/konfig" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) // kindOfAdd is the kind of metadata being added: label or annotation diff --git a/kustomize/internal/commands/edit/remove/removemetadata_test.go b/kustomize/commands/edit/remove/removemetadata_test.go similarity index 98% rename from kustomize/internal/commands/edit/remove/removemetadata_test.go rename to kustomize/commands/edit/remove/removemetadata_test.go index c0d968c5a..5ed24b036 100644 --- a/kustomize/internal/commands/edit/remove/removemetadata_test.go +++ b/kustomize/commands/edit/remove/removemetadata_test.go @@ -11,8 +11,8 @@ import ( "sigs.k8s.io/kustomize/api/filesys" valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) func makeKustomizationFS() filesys.FileSystem { diff --git a/kustomize/internal/commands/edit/remove/removepatch.go b/kustomize/commands/edit/remove/removepatch.go similarity index 97% rename from kustomize/internal/commands/edit/remove/removepatch.go rename to kustomize/commands/edit/remove/removepatch.go index f3645fc1b..d5beadd80 100644 --- a/kustomize/internal/commands/edit/remove/removepatch.go +++ b/kustomize/commands/edit/remove/removepatch.go @@ -11,7 +11,7 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/konfig" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type removePatchOptions struct { diff --git a/kustomize/internal/commands/edit/remove/removepatch_test.go b/kustomize/commands/edit/remove/removepatch_test.go similarity index 98% rename from kustomize/internal/commands/edit/remove/removepatch_test.go rename to kustomize/commands/edit/remove/removepatch_test.go index af2222336..0dd4033dd 100644 --- a/kustomize/internal/commands/edit/remove/removepatch_test.go +++ b/kustomize/commands/edit/remove/removepatch_test.go @@ -7,7 +7,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/remove/removeresource.go b/kustomize/commands/edit/remove/removeresource.go similarity index 97% rename from kustomize/internal/commands/edit/remove/removeresource.go rename to kustomize/commands/edit/remove/removeresource.go index 178de5bd4..556c4486b 100644 --- a/kustomize/internal/commands/edit/remove/removeresource.go +++ b/kustomize/commands/edit/remove/removeresource.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/konfig" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type removeResourceOptions struct { diff --git a/kustomize/internal/commands/edit/remove/removeresource_test.go b/kustomize/commands/edit/remove/removeresource_test.go similarity index 96% rename from kustomize/internal/commands/edit/remove/removeresource_test.go rename to kustomize/commands/edit/remove/removeresource_test.go index db97ce767..1085ae03b 100644 --- a/kustomize/internal/commands/edit/remove/removeresource_test.go +++ b/kustomize/commands/edit/remove/removeresource_test.go @@ -7,7 +7,7 @@ import ( "errors" "testing" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/remove_test" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit/remove_test" ) func TestRemoveResources(t *testing.T) { diff --git a/kustomize/internal/commands/edit/remove/removetransformer.go b/kustomize/commands/edit/remove/removetransformer.go similarity index 96% rename from kustomize/internal/commands/edit/remove/removetransformer.go rename to kustomize/commands/edit/remove/removetransformer.go index 0036dd868..53e126e2c 100644 --- a/kustomize/internal/commands/edit/remove/removetransformer.go +++ b/kustomize/commands/edit/remove/removetransformer.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/konfig" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type removeTransformerOptions struct { diff --git a/kustomize/internal/commands/edit/remove/removetransformer_test.go b/kustomize/commands/edit/remove/removetransformer_test.go similarity index 96% rename from kustomize/internal/commands/edit/remove/removetransformer_test.go rename to kustomize/commands/edit/remove/removetransformer_test.go index 98a4315df..ecb3a56a9 100644 --- a/kustomize/internal/commands/edit/remove/removetransformer_test.go +++ b/kustomize/commands/edit/remove/removetransformer_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/pkg/errors" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/edit/remove_test" + "sigs.k8s.io/kustomize/kustomize/v3/commands/edit/remove_test" ) func TestRemoveTransformer(t *testing.T) { diff --git a/kustomize/internal/commands/edit/remove_test/removetest.go b/kustomize/commands/edit/remove_test/removetest.go similarity index 97% rename from kustomize/internal/commands/edit/remove_test/removetest.go rename to kustomize/commands/edit/remove_test/removetest.go index 7afb30cf9..3df18c884 100644 --- a/kustomize/internal/commands/edit/remove_test/removetest.go +++ b/kustomize/commands/edit/remove_test/removetest.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) // Given represents the provided inputs for the test case. diff --git a/kustomize/internal/commands/edit/set/all.go b/kustomize/commands/edit/set/all.go similarity index 100% rename from kustomize/internal/commands/edit/set/all.go rename to kustomize/commands/edit/set/all.go diff --git a/kustomize/internal/commands/edit/set/set_name_prefix.go b/kustomize/commands/edit/set/set_name_prefix.go similarity index 95% rename from kustomize/internal/commands/edit/set/set_name_prefix.go rename to kustomize/commands/edit/set/set_name_prefix.go index 3601db912..f76a90f45 100644 --- a/kustomize/internal/commands/edit/set/set_name_prefix.go +++ b/kustomize/commands/edit/set/set_name_prefix.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type setNamePrefixOptions struct { diff --git a/kustomize/internal/commands/edit/set/set_name_prefix_test.go b/kustomize/commands/edit/set/set_name_prefix_test.go similarity index 92% rename from kustomize/internal/commands/edit/set/set_name_prefix_test.go rename to kustomize/commands/edit/set/set_name_prefix_test.go index 0690dae9e..37feeb9d4 100644 --- a/kustomize/internal/commands/edit/set/set_name_prefix_test.go +++ b/kustomize/commands/edit/set/set_name_prefix_test.go @@ -8,7 +8,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/set/set_name_suffix.go b/kustomize/commands/edit/set/set_name_suffix.go similarity index 95% rename from kustomize/internal/commands/edit/set/set_name_suffix.go rename to kustomize/commands/edit/set/set_name_suffix.go index a6ce4548f..d696ba662 100644 --- a/kustomize/internal/commands/edit/set/set_name_suffix.go +++ b/kustomize/commands/edit/set/set_name_suffix.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type setNameSuffixOptions struct { diff --git a/kustomize/internal/commands/edit/set/set_name_suffix_test.go b/kustomize/commands/edit/set/set_name_suffix_test.go similarity index 92% rename from kustomize/internal/commands/edit/set/set_name_suffix_test.go rename to kustomize/commands/edit/set/set_name_suffix_test.go index 289532052..e78d733b4 100644 --- a/kustomize/internal/commands/edit/set/set_name_suffix_test.go +++ b/kustomize/commands/edit/set/set_name_suffix_test.go @@ -8,7 +8,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/set/setimage.go b/kustomize/commands/edit/set/setimage.go similarity index 98% rename from kustomize/internal/commands/edit/set/setimage.go rename to kustomize/commands/edit/set/setimage.go index 91e79b1c0..9517d0d10 100644 --- a/kustomize/internal/commands/edit/set/setimage.go +++ b/kustomize/commands/edit/set/setimage.go @@ -13,7 +13,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type setImageOptions struct { diff --git a/kustomize/internal/commands/edit/set/setimage_test.go b/kustomize/commands/edit/set/setimage_test.go similarity index 99% rename from kustomize/internal/commands/edit/set/setimage_test.go rename to kustomize/commands/edit/set/setimage_test.go index 77a3b308c..7eb121651 100644 --- a/kustomize/internal/commands/edit/set/setimage_test.go +++ b/kustomize/commands/edit/set/setimage_test.go @@ -9,7 +9,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) func TestSetImage(t *testing.T) { diff --git a/kustomize/internal/commands/edit/set/setlabel.go b/kustomize/commands/edit/set/setlabel.go similarity index 94% rename from kustomize/internal/commands/edit/set/setlabel.go rename to kustomize/commands/edit/set/setlabel.go index 49e807b88..2aaedb06f 100644 --- a/kustomize/internal/commands/edit/set/setlabel.go +++ b/kustomize/commands/edit/set/setlabel.go @@ -10,8 +10,8 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/konfig" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/util" ) type setLabelOptions struct { diff --git a/kustomize/internal/commands/edit/set/setlabel_test.go b/kustomize/commands/edit/set/setlabel_test.go similarity index 96% rename from kustomize/internal/commands/edit/set/setlabel_test.go rename to kustomize/commands/edit/set/setlabel_test.go index b5de25c74..3672a2d87 100644 --- a/kustomize/internal/commands/edit/set/setlabel_test.go +++ b/kustomize/commands/edit/set/setlabel_test.go @@ -9,8 +9,8 @@ import ( "sigs.k8s.io/kustomize/api/filesys" valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) func makeKustomization(t *testing.T) *types.Kustomization { diff --git a/kustomize/internal/commands/edit/set/setnamespace.go b/kustomize/commands/edit/set/setnamespace.go similarity index 96% rename from kustomize/internal/commands/edit/set/setnamespace.go rename to kustomize/commands/edit/set/setnamespace.go index 823792a12..e3a0f055b 100644 --- a/kustomize/internal/commands/edit/set/setnamespace.go +++ b/kustomize/commands/edit/set/setnamespace.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/ifc" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type setNamespaceOptions struct { diff --git a/kustomize/internal/commands/edit/set/setnamespace_test.go b/kustomize/commands/edit/set/setnamespace_test.go similarity index 96% rename from kustomize/internal/commands/edit/set/setnamespace_test.go rename to kustomize/commands/edit/set/setnamespace_test.go index 2d1121867..bf1c64bae 100644 --- a/kustomize/internal/commands/edit/set/setnamespace_test.go +++ b/kustomize/commands/edit/set/setnamespace_test.go @@ -10,7 +10,7 @@ import ( "sigs.k8s.io/kustomize/api/filesys" valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) const ( diff --git a/kustomize/internal/commands/edit/set/setreplicas.go b/kustomize/commands/edit/set/setreplicas.go similarity index 97% rename from kustomize/internal/commands/edit/set/setreplicas.go rename to kustomize/commands/edit/set/setreplicas.go index ee0acbe73..86a5d4aef 100644 --- a/kustomize/internal/commands/edit/set/setreplicas.go +++ b/kustomize/commands/edit/set/setreplicas.go @@ -12,7 +12,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/types" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" + "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile" ) type setReplicasOptions struct { diff --git a/kustomize/internal/commands/edit/set/setreplicas_test.go b/kustomize/commands/edit/set/setreplicas_test.go similarity index 97% rename from kustomize/internal/commands/edit/set/setreplicas_test.go rename to kustomize/commands/edit/set/setreplicas_test.go index 00cc0375e..7208978d4 100644 --- a/kustomize/internal/commands/edit/set/setreplicas_test.go +++ b/kustomize/commands/edit/set/setreplicas_test.go @@ -9,7 +9,7 @@ import ( "testing" "sigs.k8s.io/kustomize/api/filesys" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) func TestSetReplicas(t *testing.T) { diff --git a/kustomize/internal/commands/kustfile/kustomizationfile.go b/kustomize/commands/internal/kustfile/kustomizationfile.go similarity index 100% rename from kustomize/internal/commands/kustfile/kustomizationfile.go rename to kustomize/commands/internal/kustfile/kustomizationfile.go diff --git a/kustomize/internal/commands/kustfile/kustomizationfile_test.go b/kustomize/commands/internal/kustfile/kustomizationfile_test.go similarity index 98% rename from kustomize/internal/commands/kustfile/kustomizationfile_test.go rename to kustomize/commands/internal/kustfile/kustomizationfile_test.go index 36c28969f..3c7ca3aab 100644 --- a/kustomize/internal/commands/kustfile/kustomizationfile_test.go +++ b/kustomize/commands/internal/kustfile/kustomizationfile_test.go @@ -13,7 +13,7 @@ import ( "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/api/konfig" "sigs.k8s.io/kustomize/api/types" - testutils_test "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/testutils" + testutils_test "sigs.k8s.io/kustomize/kustomize/v3/commands/internal/testutils" ) func TestFieldOrder(t *testing.T) { diff --git a/kustomize/internal/commands/testutils/testutils.go b/kustomize/commands/internal/testutils/testutils.go similarity index 100% rename from kustomize/internal/commands/testutils/testutils.go rename to kustomize/commands/internal/testutils/testutils.go diff --git a/kustomize/internal/commands/util/util.go b/kustomize/commands/internal/util/util.go similarity index 100% rename from kustomize/internal/commands/util/util.go rename to kustomize/commands/internal/util/util.go diff --git a/kustomize/internal/commands/util/util_test.go b/kustomize/commands/internal/util/util_test.go similarity index 100% rename from kustomize/internal/commands/util/util_test.go rename to kustomize/commands/internal/util/util_test.go diff --git a/kustomize/internal/commands/openapi/info/info.go b/kustomize/commands/openapi/info/info.go similarity index 100% rename from kustomize/internal/commands/openapi/info/info.go rename to kustomize/commands/openapi/info/info.go diff --git a/kustomize/internal/commands/openapi/openapi.go b/kustomize/commands/openapi/openapi.go similarity index 89% rename from kustomize/internal/commands/openapi/openapi.go rename to kustomize/commands/openapi/openapi.go index c4ae63a49..a699cc970 100644 --- a/kustomize/internal/commands/openapi/openapi.go +++ b/kustomize/commands/openapi/openapi.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" "sigs.k8s.io/kustomize/cmd/config/configcobra" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/openapi/info" + "sigs.k8s.io/kustomize/kustomize/v3/commands/openapi/info" ) // NewCmdOpenAPI makes a new openapi command. diff --git a/kustomize/internal/commands/version/version.go b/kustomize/commands/version/version.go similarity index 100% rename from kustomize/internal/commands/version/version.go rename to kustomize/commands/version/version.go diff --git a/kustomize/go.mod b/kustomize/go.mod index 688a17755..34f5c1c06 100644 --- a/kustomize/go.mod +++ b/kustomize/go.mod @@ -15,7 +15,6 @@ require ( ) exclude ( - github.com/russross/blackfriday v2.0.0+incompatible sigs.k8s.io/kustomize/api v0.2.0 sigs.k8s.io/kustomize/cmd/config v0.2.0 ) diff --git a/kustomize/main.go b/kustomize/main.go index 49005f93e..7020324b0 100644 --- a/kustomize/main.go +++ b/kustomize/main.go @@ -7,7 +7,7 @@ package main import ( "os" - "sigs.k8s.io/kustomize/kustomize/v3/internal/commands" + "sigs.k8s.io/kustomize/kustomize/v3/commands" // initialize auth // This is here rather than in the libraries because of