diff --git a/pkg/devfile/adapters/kubernetes/component/commandhandler.go b/pkg/devfile/adapters/kubernetes/component/commandhandler.go index e42a73361b3..c4e4d71a17c 100644 --- a/pkg/devfile/adapters/kubernetes/component/commandhandler.go +++ b/pkg/devfile/adapters/kubernetes/component/commandhandler.go @@ -55,7 +55,7 @@ func (a *adapterHandler) Execute(devfileCmd devfilev1.Command) error { // Creating with no spin because the command could be long-running, and we cannot determine when it will end. s.Start(fmt.Sprintf("Executing the application (command: %s)", devfileCmd.Id), true) case remotecmd.Stopped, remotecmd.Errored: - s.End(status == remotecmd.Stopped) + s.EndWithStatus(fmt.Sprintf("Finished executing the application (command: %s)", devfileCmd.Id), status == remotecmd.Stopped) if err != nil { klog.V(2).Infof("error while running background command: %v", err) } diff --git a/pkg/log/status.go b/pkg/log/status.go index 6a131f2f433..4b0a6321feb 100644 --- a/pkg/log/status.go +++ b/pkg/log/status.go @@ -221,6 +221,15 @@ func (s *Status) End(success bool) { s.status = "" } +// EndWithStatus is similar to End, but lets the user specify a custom message/status while ending +func (s *Status) EndWithStatus(status string, success bool) { + if status == "" { + return + } + s.status = status + s.End(success) +} + // Printf will output in an appropriate "information" manner; for e.g. // • func Printf(format string, a ...interface{}) {