mirror of
https://github.com/docker/compose.git
synced 2025-07-25 14:44:29 +02:00
ignore one-off container events
close https://github.com/docker/compose-cli/issues/1955 Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
6ecf8209ef
commit
4b18d30871
@ -21,10 +21,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/pkg/api"
|
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
|
|
||||||
|
"github.com/docker/compose-cli/pkg/api"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/pkg/utils"
|
"github.com/docker/compose-cli/pkg/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -40,6 +41,11 @@ func (s *composeService) Events(ctx context.Context, project string, options api
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oneOff := event.Actor.Attributes[api.OneoffLabel]
|
||||||
|
if oneOff == "True" {
|
||||||
|
// ignore
|
||||||
|
continue
|
||||||
|
}
|
||||||
service := event.Actor.Attributes[api.ServiceLabel]
|
service := event.Actor.Attributes[api.ServiceLabel]
|
||||||
if len(options.Services) > 0 && !utils.StringContains(options.Services, service) {
|
if len(options.Services) > 0 && !utils.StringContains(options.Services, service) {
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user