Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 9030f5a

Browse files
authored
Merge pull request #1987 from ndeloof/ignore_oneoff_events
ignore one-off container events
2 parents 6ecf820 + 4b18d30 commit 9030f5a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/compose/events.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ import (
2121
"strings"
2222
"time"
2323

24-
"github.com/docker/compose-cli/pkg/api"
2524
moby "github.com/docker/docker/api/types"
2625
"github.com/docker/docker/api/types/filters"
2726

27+
"github.com/docker/compose-cli/pkg/api"
28+
2829
"github.com/docker/compose-cli/pkg/utils"
2930
)
3031

@@ -40,6 +41,11 @@ func (s *composeService) Events(ctx context.Context, project string, options api
4041
continue
4142
}
4243

44+
oneOff := event.Actor.Attributes[api.OneoffLabel]
45+
if oneOff == "True" {
46+
// ignore
47+
continue
48+
}
4349
service := event.Actor.Attributes[api.ServiceLabel]
4450
if len(options.Services) > 0 && !utils.StringContains(options.Services, service) {
4551
continue

0 commit comments

Comments
 (0)