Skip to content

Commit

Permalink
fix: delete all tests nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
exu committed Jan 20, 2022
1 parent 61f1f1b commit 389c754
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/kubectl-testkube/commands/scripts/deleteall.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
)

func NewDeleteAllScriptsCmd() *cobra.Command {
var name string
cmd := &cobra.Command{
Use: "delete-all",
Short: "Delete all scripts",
Expand All @@ -16,10 +15,11 @@ func NewDeleteAllScriptsCmd() *cobra.Command {
namespace := cmd.Flag("namespace").Value.String()

client, _ := common.GetClient(cmd)

err := client.DeleteScripts(namespace)
ui.ExitOnError("delete all scripts from namespace "+namespace, err)

ui.Success("Succesfully deleted", name)
ui.Success("Succesfully deleted all scripts in namespace", namespace)
},
}

Expand Down
3 changes: 1 addition & 2 deletions cmd/kubectl-testkube/commands/tests/deleteall.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ func NewDeleteTestsCmd() *cobra.Command {

client, namespace := common.GetClient(cmd)

name := args[0]
err := client.DeleteTests(namespace)
ui.ExitOnError("delete all tests from namespace "+namespace, err)
ui.Success("Succesfully deleted", name)
ui.Success("Succesfully deleted all tests in namespace", namespace)
},
}

Expand Down

0 comments on commit 389c754

Please sign in to comment.