Skip to content

Commit

Permalink
delete: use cli.Cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Mate Ory authored and stoader committed Jun 18, 2019
1 parent 2c575e1 commit 46ed2a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/cli/command/cluster/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ func NewDeleteCommand(banzaiCli cli.Cli) *cobra.Command {
return cmd
}

func runDelete(_ cli.Cli, options deleteOptions, args []string) error {
client := InitPipeline()
orgId := GetOrgId(true)
func runDelete(banzaiCli cli.Cli, options deleteOptions, args []string) error {
client := banzaiCli.Client()
orgId := banzaiCli.Context().OrganizationID()
clusters, _, err := client.ClustersApi.ListClusters(context.Background(), orgId)
if err != nil {
cli.LogAPIError("list clusters", err, orgId)
Expand All @@ -72,7 +72,7 @@ func runDelete(_ cli.Cli, options deleteOptions, args []string) error {
return errors.New(fmt.Sprintf("cluster %q could not be found", args[0]))
}

if isInteractive() {
if banzaiCli.Interactive() {
if cluster, _, err := client.ClustersApi.GetCluster(context.Background(), orgId, id); err != nil {
cli.LogAPIError("get cluster", err, id)
} else {
Expand Down

0 comments on commit 46ed2a3

Please sign in to comment.