Skip to content

Commit

Permalink
backport of commit 5c5a7cd
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 1, 2023
1 parent c02cf8d commit ebd4c9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/16011.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: Fixed a panic in `deployment status` when rollback deployments are slow to appear
```
4 changes: 2 additions & 2 deletions command/deployment_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ UPDATE:
// TODO We may want to find a more robust way of waiting for rollbacks to launch instead of
// just sleeping for 1 sec. If scheduling is slow, this will break update here instead of
// waiting for the (eventual) rollback
if rollback.ID == deploy.ID {
if rollback == nil || rollback.ID == deploy.ID {
break UPDATE
}

Expand Down Expand Up @@ -436,7 +436,7 @@ func (c *DeploymentStatusCommand) defaultMonitor(client *api.Client, deployID st
// TODO We may want to find a more robust way of waiting for rollbacks to launch instead of
// just sleeping for 1 sec. If scheduling is slow, this will break update here instead of
// waiting for the (eventual) rollback
if rollback.ID == deploy.ID {
if rollback == nil || rollback.ID == deploy.ID {
return
}
c.defaultMonitor(client, rollback.ID, index, verbose)
Expand Down

0 comments on commit ebd4c9e

Please sign in to comment.