diff --git a/command/deployment_status.go b/command/deployment_status.go index 5380ea310..c5257f239 100644 --- a/command/deployment_status.go +++ b/command/deployment_status.go @@ -195,7 +195,7 @@ func formatDeployment(d *api.Deployment, uuidLength int) string { func formatDeploymentGroups(d *api.Deployment, uuidLength int) string { // Detect if we need to add these columns - canaries, autorevert := false, false + var canaries, autorevert, progressDeadline bool tgNames := make([]string, 0, len(d.TaskGroups)) for name, state := range d.TaskGroups { tgNames = append(tgNames, name) @@ -205,6 +205,9 @@ func formatDeploymentGroups(d *api.Deployment, uuidLength int) string { if state.DesiredCanaries > 0 { canaries = true } + if state.ProgressDeadline != 0 { + progressDeadline = true + } } // Sort the task group names to get a reliable ordering @@ -223,6 +226,9 @@ func formatDeploymentGroups(d *api.Deployment, uuidLength int) string { rowString += "Canaries|" } rowString += "Placed|Healthy|Unhealthy" + if progressDeadline { + rowString += "|Progress Deadline" + } rows := make([]string, len(d.TaskGroups)+1) rows[0] = rowString @@ -245,6 +251,13 @@ func formatDeploymentGroups(d *api.Deployment, uuidLength int) string { row += fmt.Sprintf("%d|", state.DesiredCanaries) } row += fmt.Sprintf("%d|%d|%d", state.PlacedAllocs, state.HealthyAllocs, state.UnhealthyAllocs) + if progressDeadline { + if state.RequireProgressBy.IsZero() { + row += fmt.Sprintf("|%v", "N/A") + } else { + row += fmt.Sprintf("|%v", formatTime(state.RequireProgressBy)) + } + } rows[i] = row i++ }