Skip to content

Commit

Permalink
feat: update wording on remove
Browse files Browse the repository at this point in the history
  • Loading branch information
raulb committed Oct 18, 2021
1 parent 35a1643 commit a24df75
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions cmd/meroxa/root/environments/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"encoding/json"
"errors"

"github.com/golang/mock/gomock"
"github.com/meroxa/cli/log"
mock "github.com/meroxa/cli/mock-cmd"
Expand Down
5 changes: 3 additions & 2 deletions cmd/meroxa/root/environments/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package environments
import (
"context"
"errors"

"github.com/meroxa/cli/cmd/meroxa/builder"
"github.com/meroxa/cli/log"
"github.com/meroxa/meroxa-go"
Expand Down Expand Up @@ -64,15 +65,15 @@ func (r *Remove) Confirm(_ context.Context) (wantInput string) {
}

func (r *Remove) Execute(ctx context.Context) error {
r.logger.Infof(ctx, "Removing environment %q...", r.args.Name)
r.logger.Infof(ctx, "Environment %q is being removed...", r.args.Name)

// TODO: Check if this could return also env
err := r.client.DeleteEnvironment(ctx, r.args.Name)
if err != nil {
return err
}

r.logger.Infof(ctx, "Environment %q successfully removed", r.args.Name)
r.logger.Infof(ctx, "\nRun `meroxa env describe %q` for status.", r.args.Name)

e, err := r.client.GetEnvironment(ctx, r.args.Name)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions cmd/meroxa/root/environments/remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ import (
"context"
"encoding/json"
"errors"

"fmt"
"reflect"
"testing"

"github.com/golang/mock/gomock"
"github.com/meroxa/cli/log"
mock "github.com/meroxa/cli/mock-cmd"
"github.com/meroxa/cli/utils"
"github.com/meroxa/meroxa-go"
"reflect"
"testing"
)

func TestRemoveEnvironmentArgs(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions utils/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func EnvironmentsTable(environments []*meroxa.Environment, hideHeaders bool) str
func EnvironmentTable(environment *meroxa.Environment) string {
mainTable := simpletable.New()

envStatus := fmt.Sprintf("%s", environment.Status.State)
envStatus := environment.Status.State

if environment.Status.Details != "" {
envStatus += fmt.Sprintf("\n\nDetails: %s", environment.Status.Details)
Expand All @@ -408,7 +408,7 @@ func EnvironmentTable(environment *meroxa.Environment) string {
mainTable.Body.Cells = [][]*simpletable.Cell{
{
{Align: simpletable.AlignRight, Text: "UUID:"},
{Text: fmt.Sprintf("%s", environment.UUID)},
{Text: environment.UUID},
},
{
{Align: simpletable.AlignRight, Text: "Name:"},
Expand Down

0 comments on commit a24df75

Please sign in to comment.