Skip to content

Commit 2ef5316

Browse files
authored
Fix UX issue when exec command fails to run as part of a deploy command (#6673)
For the context, before the changes, the "Execution output" message was displayed on the same line as the spinner, e.g.: ``` ↪ Executing command: ◓ Executing command in container (command: exec-deploy)Execution output: /bin/sh: line 1: helm: command not found ✗ Executing command in container (command: exec-deploy) [8s] ✗ failed to execute (command: exec-deploy) ``` This is now fixed by ending the spinner as soon as possible, and then displaying the command output: ``` ↪ Executing command: ✗ Executing command in container (command: exec-deploy) [8s] Execution output: /bin/sh: line 1: helm: command not found ✗ failed to execute (command: exec-deploy) ```
1 parent 47234b9 commit 2ef5316

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/deploy/deploy.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ func (o *deployHandler) Execute(command v1alpha2.Command) error {
192192
// Wait for the command to complete execution
193193
_, err = o.kubeClient.WaitForJobToComplete(createdJob)
194194
done <- struct{}{}
195+
196+
spinner.End(err == nil)
197+
195198
if err != nil {
196199
err = fmt.Errorf("failed to execute (command: %s)", command.Id)
197200
// Print the job logs if the job failed
@@ -203,8 +206,6 @@ func (o *deployHandler) Execute(command v1alpha2.Command) error {
203206
_ = util.DisplayLog(false, jobLogs, log.GetStderr(), o.componentName, 100)
204207
}
205208

206-
spinner.End(err == nil)
207-
208209
return err
209210
}
210211

0 commit comments

Comments
 (0)