diff --git a/pkg/internal/k8sdeps/decoder.go b/internal/k8sdeps/decoder.go similarity index 100% rename from pkg/internal/k8sdeps/decoder.go rename to internal/k8sdeps/decoder.go diff --git a/pkg/internal/k8sdeps/doc.go b/internal/k8sdeps/doc.go similarity index 100% rename from pkg/internal/k8sdeps/doc.go rename to internal/k8sdeps/doc.go diff --git a/pkg/internal/k8sdeps/validators.go b/internal/k8sdeps/validators.go similarity index 100% rename from pkg/internal/k8sdeps/validators.go rename to internal/k8sdeps/validators.go diff --git a/kustomize.go b/kustomize.go index bd6d51ddc..41dcb9043 100644 --- a/kustomize.go +++ b/kustomize.go @@ -20,14 +20,16 @@ import ( "os" "github.com/golang/glog" - + "sigs.k8s.io/kustomize/internal/k8sdeps" "sigs.k8s.io/kustomize/pkg/commands" ) func main() { defer glog.Flush() - if err := commands.NewDefaultCommand().Execute(); err != nil { + if err := commands.NewDefaultCommand( + k8sdeps.NewKustDecoder(), + k8sdeps.NewKustValidator()).Execute(); err != nil { os.Exit(1) } os.Exit(0) diff --git a/pkg/commands/build_test.go b/pkg/commands/build_test.go index 4fb6e0ca8..66abaf01d 100644 --- a/pkg/commands/build_test.go +++ b/pkg/commands/build_test.go @@ -22,7 +22,7 @@ import ( "os" "path/filepath" "reflect" - "sigs.k8s.io/kustomize/pkg/internal/k8sdeps" + "sigs.k8s.io/kustomize/internal/k8sdeps" "strings" "testing" diff --git a/pkg/commands/commands.go b/pkg/commands/commands.go index acaaf601f..afb803ca5 100644 --- a/pkg/commands/commands.go +++ b/pkg/commands/commands.go @@ -20,7 +20,6 @@ package commands import ( "flag" "os" - "sigs.k8s.io/kustomize/pkg/internal/k8sdeps" "github.com/spf13/cobra" "sigs.k8s.io/kustomize/pkg/fs" @@ -28,7 +27,8 @@ import ( ) // NewDefaultCommand returns the default (aka root) command for kustomize command. -func NewDefaultCommand() *cobra.Command { +func NewDefaultCommand( + decoder ifc.Decoder, validator ifc.Validator) *cobra.Command { fsys := fs.MakeRealFS() stdOut := os.Stdout @@ -44,8 +44,8 @@ See https://sigs.k8s.io/kustomize c.AddCommand( // TODO: Make consistent API for newCmd* functions. - newCmdBuild(stdOut, fsys, k8sdeps.NewKustDecoder()), - newCmdEdit(fsys, k8sdeps.NewKustValidator()), + newCmdBuild(stdOut, fsys, decoder), + newCmdEdit(fsys, validator), newCmdConfig(fsys), newCmdVersion(stdOut), ) diff --git a/pkg/resmap/resmap_test.go b/pkg/resmap/resmap_test.go index d42cd4b8e..d5994b82f 100644 --- a/pkg/resmap/resmap_test.go +++ b/pkg/resmap/resmap_test.go @@ -19,7 +19,7 @@ package resmap import ( "fmt" "reflect" - "sigs.k8s.io/kustomize/pkg/internal/k8sdeps" + "sigs.k8s.io/kustomize/internal/k8sdeps" "testing" "sigs.k8s.io/kustomize/pkg/gvk" diff --git a/pkg/resource/resource_test.go b/pkg/resource/resource_test.go index 8687e99cb..10a610933 100644 --- a/pkg/resource/resource_test.go +++ b/pkg/resource/resource_test.go @@ -18,7 +18,7 @@ package resource import ( "reflect" - "sigs.k8s.io/kustomize/pkg/internal/k8sdeps" + "sigs.k8s.io/kustomize/internal/k8sdeps" "testing" "sigs.k8s.io/kustomize/pkg/internal/loadertest" diff --git a/pkg/target/kusttarget_test.go b/pkg/target/kusttarget_test.go index 48decb7de..f582446e1 100644 --- a/pkg/target/kusttarget_test.go +++ b/pkg/target/kusttarget_test.go @@ -19,7 +19,7 @@ package target import ( "encoding/base64" "reflect" - "sigs.k8s.io/kustomize/pkg/internal/k8sdeps" + "sigs.k8s.io/kustomize/internal/k8sdeps" "strings" "testing"