mirror of https://github.com/docker/cli.git
Merge pull request #2939 from thaJeztah/fix_swarm_rollback_exitcode
Fix swarm rollback exitcode, and fix skipping verify step
This commit is contained in:
commit
375faee9bc
|
@ -99,6 +99,7 @@ func ServiceProgress(ctx context.Context, client client.APIClient, serviceID str
|
||||||
convergedAt time.Time
|
convergedAt time.Time
|
||||||
monitor = 5 * time.Second
|
monitor = 5 * time.Second
|
||||||
rollback bool
|
rollback bool
|
||||||
|
message *progress.Progress
|
||||||
)
|
)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
@ -140,8 +141,9 @@ func ServiceProgress(ctx context.Context, client client.APIClient, serviceID str
|
||||||
return fmt.Errorf("service rollback paused: %s", service.UpdateStatus.Message)
|
return fmt.Errorf("service rollback paused: %s", service.UpdateStatus.Message)
|
||||||
case swarm.UpdateStateRollbackCompleted:
|
case swarm.UpdateStateRollbackCompleted:
|
||||||
if !converged {
|
if !converged {
|
||||||
return fmt.Errorf("service rolled back: %s", service.UpdateStatus.Message)
|
message = &progress.Progress{ID: "rollback", Message: service.UpdateStatus.Message}
|
||||||
}
|
}
|
||||||
|
rollback = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if converged && time.Since(convergedAt) >= monitor {
|
if converged && time.Since(convergedAt) >= monitor {
|
||||||
|
@ -149,7 +151,9 @@ func ServiceProgress(ctx context.Context, client client.APIClient, serviceID str
|
||||||
ID: "verify",
|
ID: "verify",
|
||||||
Action: "Service converged",
|
Action: "Service converged",
|
||||||
})
|
})
|
||||||
|
if message != nil {
|
||||||
|
progressOut.WriteProgress(*message)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue