Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: Fix a panic in deployment status when scheduling is slow #16011

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -332,7 +332,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 @@ -441,7 +441,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, wait, verbose)
Expand Down