diff --git a/cmd/kubectl-testkube/commands/docker.go b/cmd/kubectl-testkube/commands/docker.go deleted file mode 100644 index b424e496b7..0000000000 --- a/cmd/kubectl-testkube/commands/docker.go +++ /dev/null @@ -1,21 +0,0 @@ -package commands - -import ( - "github.com/spf13/cobra" - - "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/docker" -) - -func NewDockerCmd() *cobra.Command { - - cmd := &cobra.Command{ - Use: "docker", - Short: "Testkube Docker commands", - Run: func(cmd *cobra.Command, args []string) { - }, - } - - cmd.AddCommand(docker.NewInitCmd()) - - return cmd -} diff --git a/cmd/kubectl-testkube/commands/pro.go b/cmd/kubectl-testkube/commands/pro.go index 09986b4c75..4fae70e3bc 100644 --- a/cmd/kubectl-testkube/commands/pro.go +++ b/cmd/kubectl-testkube/commands/pro.go @@ -19,6 +19,7 @@ func NewProCmd() *cobra.Command { cmd.AddCommand(pro.NewDisconnectCmd()) cmd.AddCommand(pro.NewInitCmd()) cmd.AddCommand(pro.NewLoginCmd()) + cmd.AddCommand(pro.NewDockerCmd()) return cmd } diff --git a/cmd/kubectl-testkube/commands/docker/init.go b/cmd/kubectl-testkube/commands/pro/docker.go similarity index 79% rename from cmd/kubectl-testkube/commands/docker/init.go rename to cmd/kubectl-testkube/commands/pro/docker.go index 892927f0d5..49f8e1b8b5 100644 --- a/cmd/kubectl-testkube/commands/docker/init.go +++ b/cmd/kubectl-testkube/commands/pro/docker.go @@ -1,8 +1,7 @@ -package docker +package pro import ( "errors" - "fmt" "os" "github.com/pterm/pterm" @@ -10,11 +9,10 @@ import ( "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common" "github.com/kubeshop/testkube/cmd/kubectl-testkube/config" - "github.com/kubeshop/testkube/pkg/telemetry" "github.com/kubeshop/testkube/pkg/ui" ) -func NewInitCmd() *cobra.Command { +func NewDockerCmd() *cobra.Command { var noLogin bool // ignore ask for login var dockerContainerName, dockerImage string var options common.HelmOptions @@ -27,9 +25,9 @@ func NewInitCmd() *cobra.Command { } cmd := &cobra.Command{ - Use: "init", + Use: "docker", Short: "Run Testkube Docker Agent and connect to Testkube Pro environment", - Aliases: []string{"install", "agent"}, + Aliases: []string{"da", "docker-agent"}, Run: func(cmd *cobra.Command, args []string) { ui.Info("WELCOME TO") ui.Logo() @@ -139,28 +137,3 @@ func NewInitCmd() *cobra.Command { return cmd } - -func sendErrTelemetry(cmd *cobra.Command, clientCfg config.Data, errType string, errorLogs error) { - var errorStackTrace string - errorStackTrace = fmt.Sprintf("%+v", errorLogs) - if clientCfg.TelemetryEnabled { - ui.Debug("collecting anonymous telemetry data, you can disable it by calling `kubectl testkube disable telemetry`") - out, err := telemetry.SendCmdErrorEvent(cmd, common.Version, errType, errorStackTrace) - if ui.Verbose && err != nil { - ui.Err(err) - } - - ui.Debug("telemetry send event response", out) - } -} - -func sendAttemptTelemetry(cmd *cobra.Command, clientCfg config.Data) { - if clientCfg.TelemetryEnabled { - ui.Debug("collecting anonymous telemetry data, you can disable it by calling `kubectl testkube disable telemetry`") - out, err := telemetry.SendCmdAttemptEvent(cmd, common.Version) - if ui.Verbose && err != nil { - ui.Err(err) - } - ui.Debug("telemetry send event response", out) - } -} diff --git a/cmd/kubectl-testkube/commands/root.go b/cmd/kubectl-testkube/commands/root.go index 9e3bc87718..464f6657f6 100644 --- a/cmd/kubectl-testkube/commands/root.go +++ b/cmd/kubectl-testkube/commands/root.go @@ -62,7 +62,6 @@ func init() { RootCmd.AddCommand(NewAgentCmd()) RootCmd.AddCommand(NewCloudCmd()) RootCmd.AddCommand(NewProCmd()) - RootCmd.AddCommand(NewDockerCmd()) RootCmd.AddCommand(pro.NewLoginCmd()) RootCmd.SetHelpCommand(NewHelpCmd())