mirror of
https://github.com/docker/compose.git
synced 2025-07-07 05:44:25 +02:00
Merge pull request #818 from docker/ecs_event_status
Remove status truncate on wait
This commit is contained in:
commit
d5ed2bdecf
13
ecs/wait.go
13
ecs/wait.go
@ -74,8 +74,7 @@ func (b *ecsAPIService) WaitStackCompletion(ctx context.Context, name string, op
|
|||||||
knownEvents[*event.EventId] = struct{}{}
|
knownEvents[*event.EventId] = struct{}{}
|
||||||
|
|
||||||
resource := aws.StringValue(event.LogicalResourceId)
|
resource := aws.StringValue(event.LogicalResourceId)
|
||||||
reason := shortenMessage(
|
reason := aws.StringValue(event.ResourceStatusReason)
|
||||||
aws.StringValue(event.ResourceStatusReason))
|
|
||||||
status := aws.StringValue(event.ResourceStatus)
|
status := aws.StringValue(event.ResourceStatus)
|
||||||
progressStatus := progress.Working
|
progressStatus := progress.Working
|
||||||
|
|
||||||
@ -116,21 +115,13 @@ func (b *ecsAPIService) WaitStackCompletion(ctx context.Context, name string, op
|
|||||||
}
|
}
|
||||||
stackErr = err
|
stackErr = err
|
||||||
operation = stackDelete
|
operation = stackDelete
|
||||||
reason := shortenMessage(err.Error())
|
|
||||||
w.Event(progress.Event{
|
w.Event(progress.Event{
|
||||||
ID: name,
|
ID: name,
|
||||||
Status: progress.Error,
|
Status: progress.Error,
|
||||||
StatusText: reason,
|
StatusText: err.Error(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return stackErr
|
return stackErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func shortenMessage(message string) string {
|
|
||||||
if len(message) < 30 {
|
|
||||||
return message
|
|
||||||
}
|
|
||||||
return message[:30] + "..."
|
|
||||||
}
|
|
||||||
|
@ -146,12 +146,19 @@ func lineText(event Event, terminalWidth, statusPadding int, color bool) string
|
|||||||
if padding < 0 {
|
if padding < 0 {
|
||||||
padding = 0
|
padding = 0
|
||||||
}
|
}
|
||||||
|
// calculate the max length for the status text, on errors it
|
||||||
|
// is 2-3 lines long and breaks the line formating
|
||||||
|
maxStatusLen := terminalWidth - textLen - statusPadding - 15
|
||||||
|
status := event.StatusText
|
||||||
|
if len(status) > maxStatusLen {
|
||||||
|
status = status[:maxStatusLen] + "..."
|
||||||
|
}
|
||||||
text := fmt.Sprintf(" %s %s %s%s %s",
|
text := fmt.Sprintf(" %s %s %s%s %s",
|
||||||
event.spinner.String(),
|
event.spinner.String(),
|
||||||
event.ID,
|
event.ID,
|
||||||
event.Text,
|
event.Text,
|
||||||
strings.Repeat(" ", padding),
|
strings.Repeat(" ", padding),
|
||||||
event.StatusText,
|
status,
|
||||||
)
|
)
|
||||||
timer := fmt.Sprintf("%.1fs\n", elapsed)
|
timer := fmt.Sprintf("%.1fs\n", elapsed)
|
||||||
o := align(text, timer, terminalWidth)
|
o := align(text, timer, terminalWidth)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user