Skip to content

Commit

Permalink
Revert "fix: move docker command"
Browse files Browse the repository at this point in the history
This reverts commit eab53e9.
  • Loading branch information
vsukhin committed Oct 17, 2024
1 parent eab53e9 commit b15d73b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 53 deletions.
21 changes: 0 additions & 21 deletions cmd/kubectl-testkube/commands/docker.go

This file was deleted.

1 change: 1 addition & 0 deletions cmd/kubectl-testkube/commands/pro.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package docker
package pro

import (
"errors"
"fmt"
"os"

"github.com/pterm/pterm"
"github.com/spf13/cobra"

"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
Expand All @@ -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()
Expand Down Expand Up @@ -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)
}
}
1 change: 0 additions & 1 deletion cmd/kubectl-testkube/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit b15d73b

Please sign in to comment.