From 4b18d3087181ebba02c3c862ca3a8415770bd016 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 5 Aug 2021 11:50:32 +0200 Subject: [PATCH] ignore one-off container events close https://github.com/docker/compose-cli/issues/1955 Signed-off-by: Nicolas De Loof --- pkg/compose/events.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/compose/events.go b/pkg/compose/events.go index a17fe707a..bc28838dd 100644 --- a/pkg/compose/events.go +++ b/pkg/compose/events.go @@ -21,10 +21,11 @@ import ( "strings" "time" - "github.com/docker/compose-cli/pkg/api" moby "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" + "github.com/docker/compose-cli/pkg/api" + "github.com/docker/compose-cli/pkg/utils" ) @@ -40,6 +41,11 @@ func (s *composeService) Events(ctx context.Context, project string, options api continue } + oneOff := event.Actor.Attributes[api.OneoffLabel] + if oneOff == "True" { + // ignore + continue + } service := event.Actor.Attributes[api.ServiceLabel] if len(options.Services) > 0 && !utils.StringContains(options.Services, service) { continue