diff --git a/cli/command/service/progress/progress.go b/cli/command/service/progress/progress.go index 261cfe55ae..3ed41cb9e4 100644 --- a/cli/command/service/progress/progress.go +++ b/cli/command/service/progress/progress.go @@ -99,6 +99,7 @@ func ServiceProgress(ctx context.Context, client client.APIClient, serviceID str convergedAt time.Time monitor = 5 * time.Second rollback bool + message *progress.Progress ) for { @@ -140,9 +141,9 @@ func ServiceProgress(ctx context.Context, client client.APIClient, serviceID str return fmt.Errorf("service rollback paused: %s", service.UpdateStatus.Message) case swarm.UpdateStateRollbackCompleted: if !converged { - progress.Messagef(progressOut, "", "service rolled back: %s", service.UpdateStatus.Message) - return nil + message = &progress.Progress{ID: "rollback", Message: service.UpdateStatus.Message} } + rollback = true } } if converged && time.Since(convergedAt) >= monitor { @@ -150,7 +151,9 @@ func ServiceProgress(ctx context.Context, client client.APIClient, serviceID str ID: "verify", Action: "Service converged", }) - + if message != nil { + progressOut.WriteProgress(*message) + } return nil }