diff --git a/pkg/cmd/get.go b/pkg/cmd/get.go index 27f5c82e..d413bd17 100644 --- a/pkg/cmd/get.go +++ b/pkg/cmd/get.go @@ -3,7 +3,7 @@ package cmd import ( "fmt" - "github.com/fntlnz/kubectl-trace/factory" + "github.com/fntlnz/kubectl-trace/pkg/factory" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" // "k8s.io/kubernetes/pkg/kubectl/util/templates" diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index 52e13601..55a1650f 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -4,10 +4,9 @@ import ( "fmt" "github.com/davecgh/go-spew/spew" - "github.com/fntlnz/kubectl-trace/factory" + "github.com/fntlnz/kubectl-trace/pkg/factory" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" - // "k8s.io/kubernetes/pkg/kubectl/util/templates" ) var ( @@ -37,7 +36,8 @@ var ( type RunOptions struct { genericclioptions.IOStreams - namespace string + namespace string + explicitNamespace bool // Local to this command container string @@ -122,9 +122,7 @@ func (o *RunOptions) Validate(cmd *cobra.Command, args []string) error { // Complete completes the setup of the command. func (o *RunOptions) Complete(factory factory.Factory, cmd *cobra.Command, args []string) error { - spew.Dump(o) - - o.namespace, _, _ = factory.ToRawKubeConfigLoader().Namespace() + o.namespace, o.explicitNamespace, _ = factory.ToRawKubeConfigLoader().Namespace() spew.Dump(o) diff --git a/pkg/cmd/trace.go b/pkg/cmd/trace.go index b1c9bce6..674e3207 100644 --- a/pkg/cmd/trace.go +++ b/pkg/cmd/trace.go @@ -3,13 +3,10 @@ package cmd import ( "fmt" - "github.com/fntlnz/kubectl-trace/factory" + "github.com/fntlnz/kubectl-trace/pkg/factory" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" - // cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - // "k8s.io/kubernetes/pkg/kubectl/util/i18n" - // "k8s.io/kubectl/pkg/pluginutils" ) // Possible resources include (case insensitive): diff --git a/factory/factory.go b/pkg/factory/factory.go similarity index 100% rename from factory/factory.go rename to pkg/factory/factory.go diff --git a/factory/matchversion.go b/pkg/factory/matchversion.go similarity index 100% rename from factory/matchversion.go rename to pkg/factory/matchversion.go diff --git a/factory/setk8sdefaults.go b/pkg/factory/setk8sdefaults.go similarity index 100% rename from factory/setk8sdefaults.go rename to pkg/factory/setk8sdefaults.go