Skip to content

Commit

Permalink
engine: remove the filter docker events code
Browse files Browse the repository at this point in the history
The docker events filter part has been moved to docker_events_buffer
  • Loading branch information
richardpen committed Oct 12, 2017
1 parent 43f36c6 commit 1045da5
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions agent/engine/docker_container_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,6 @@ func (dg *dockerGoClient) ContainerEvents(ctx context.Context) (<-chan DockerCon

go func() {
for event := range events {
// currently only container events type needs to be handled
if event.Type != "container" || event.ID == "" {
continue
}

containerID := event.ID
log.Debug("Got event from docker daemon", "event", event)

Expand All @@ -777,23 +772,6 @@ func (dg *dockerGoClient) ContainerEvents(ctx context.Context) (<-chan DockerCon
fallthrough
case "die":
status = api.ContainerStopped
case "kill":
fallthrough
case "rename":
// TODO, ensure this wasn't one of our containers. This isn't critical
// because we typically have the docker id stored too and a wrong name
// won't be fatal once we do
continue
case "restart":
case "resize":
case "unpause":
case "destroy":
// container remove events doesn't need to be handled by ecs agent
// as it has already moved to stopped before this event
continue

// These result in us falling through to inspect the container, some
// out of caution, some because it's a form of state change
case "oom":
containerInfo := event.ID
// events only contain the container's name in newer Docker API
Expand All @@ -806,39 +784,8 @@ func (dg *dockerGoClient) ContainerEvents(ctx context.Context) (<-chan DockerCon
// "oom" can either means any process got OOM'd, but doesn't always
// mean the container dies (non-init processes). If the container also
// dies, you see a "die" status as well; we'll update suitably there
fallthrough
case "pause":
// non image events that aren't of interest currently
fallthrough
case "exec_create":
fallthrough
case "exec_start":
fallthrough
case "top":
fallthrough
case "attach":
fallthrough
// image events
case "export":
fallthrough
case "pull":
fallthrough
case "push":
fallthrough
case "tag":
fallthrough
case "untag":
fallthrough
case "import":
fallthrough
case "delete":
// No interest in image events
continue
default:
if strings.HasPrefix(event.Status, "exec_create:") || strings.HasPrefix(event.Status, "exec_start:") {
continue
}

// Because docker emits new events even when you use an old event api
// version, it's not that big a deal
seelog.Debugf("Unknown status event from docker: %s", event.Status)
Expand Down

0 comments on commit 1045da5

Please sign in to comment.