mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
CLI
This commit is contained in:
committed by
Preetha Appan
parent
c240e021cc
commit
eb6a99a6d8
@@ -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++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user