Merge pull request #1301 from docker/color_fix

fix color assignment on status messages
This commit is contained in:
Nicolas De loof 2021-02-16 10:43:16 +01:00 committed by GitHub
commit 8029db807c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 34 deletions

View file

@ -320,11 +320,11 @@ func (p printer) run(ctx context.Context, cascadeStop bool, exitCodeFrom string,
event := <-p.queue
switch event.Type {
case compose.ContainerEventAttach:
consumer.Register(event.Service, event.Source)
consumer.Register(event.Name, event.Source)
count++
case compose.ContainerEventExit:
if !aborting {
consumer.Status(event.Service, event.Source, fmt.Sprintf("exited with code %d", event.ExitCode))
consumer.Status(event.Name, event.Source, fmt.Sprintf("exited with code %d", event.ExitCode))
}
if cascadeStop {
if !aborting {
@ -347,7 +347,7 @@ func (p printer) run(ctx context.Context, cascadeStop bool, exitCodeFrom string,
}
case compose.ContainerEventLog:
if !aborting {
consumer.Log(event.Service, event.Source, event.Line)
consumer.Log(event.Name, event.Source, event.Line)
}
}
}