Skip to content

Commit

Permalink
upd(repair): improve command output
Browse files Browse the repository at this point in the history
  • Loading branch information
jayjayjpg committed Feb 2, 2022
1 parent e0fc961 commit b26961d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/meroxa/root/environments/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (r *Repair) Usage() string {
func (r *Repair) Docs() builder.Docs {
return builder.Docs{
Short: "Repair environment",
Long: "Repair any environment that is in one of the following states: provisioning_error, deprovisioning_error, repairing_error.",
Long: `Repair any environment that is in one of the following states: provisioning_error, deprovisioning_error, repairing_error.`,
}
}

Expand All @@ -74,13 +74,13 @@ func (r *Repair) ParseArgs(args []string) error {
}

func (r *Repair) Execute(ctx context.Context) error {
rr, err := r.client.PerformActionOnEnvironment(ctx, r.args.NameOrUUID, &meroxa.RepairEnvironmentInput{Action: "repair"}) /* OPENQ: How do I pass a struct here? */
rr, err := r.client.PerformActionOnEnvironment(ctx, r.args.NameOrUUID, &meroxa.RepairEnvironmentInput{Action: "repair"})
if err != nil {
return err
}

r.logger.Infof(ctx, "The repairment of your environment %q is now in progress. Run `meroxa env describe %s` for status", r.args.NameOrUUID)
r.logger.Info(ctx, "Meroxa will try to resolve the error and your environment should be up and running soon.")
r.logger.Infof(ctx, `The repairment of your environment %q is now in progress and your environment will be up and running soon.`, r.args.NameOrUUID) // nolint:lll
r.logger.Infof(ctx, `Run "meroxa env describe %s" for status.`, r.args.NameOrUUID)
r.logger.JSON(ctx, rr)

return nil
Expand Down
3 changes: 2 additions & 1 deletion cmd/meroxa/root/environments/repair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ func TestRepairEnvironmentExecution(t *testing.T) {

gotLeveledOutput := logger.LeveledOutput()
wantLeveledOutput := fmt.Sprintf(
"Repairing environment...\nThe repairment of your environment %q is now in progress. Run `meroxa env describe %s` for status",
`The repairment of your environment %q is now in progress and your environment will be up and running soon.
Run "meroxa env describe %s" for status.`,
e.Name,
e.Name)

Expand Down

0 comments on commit b26961d

Please sign in to comment.