diff --git a/api/compose/api.go b/api/compose/api.go index 7240eca25..3dcf17341 100644 --- a/api/compose/api.go +++ b/api/compose/api.go @@ -68,7 +68,7 @@ type StartOptions struct { // Attach will attach to container and pipe stdout/stderr to LogConsumer Attach LogConsumer // Listener will get notified on container events - Listener Listener + Listener chan ContainerExited } // UpOptions group options of the Up API @@ -188,11 +188,8 @@ type LogConsumer interface { Status(service, container, message string) } -// Listener get notified on container Events -type Listener chan Event - -// Event let us know a Container exited -type Event struct { +// ContainerExited let us know a Container exited +type ContainerExited struct { Service string Status int } diff --git a/cli/cmd/compose/up.go b/cli/cmd/compose/up.go index bdb50f0cc..32e99b6fe 100644 --- a/cli/cmd/compose/up.go +++ b/cli/cmd/compose/up.go @@ -151,7 +151,7 @@ func runCreateStart(ctx context.Context, opts upOptions, services []string) erro } ctx, cancel := context.WithCancel(ctx) - listener := make(chan compose.Event) + listener := make(chan compose.ContainerExited) go func() { var aborting bool for { diff --git a/local/compose/start.go b/local/compose/start.go index 3315587e3..30fcc5f21 100644 --- a/local/compose/start.go +++ b/local/compose/start.go @@ -64,7 +64,7 @@ func (s *composeService) Start(ctx context.Context, project *types.Project, opti service := c.Labels[serviceLabel] options.Attach.Status(service, getCanonicalContainerName(c), fmt.Sprintf("exited with code %d", status.StatusCode)) if options.Listener != nil { - options.Listener <- compose.Event{ + options.Listener <- compose.ContainerExited{ Service: service, Status: int(status.StatusCode), }