Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #407 from thaJeztah/19.03_backport_better_containe…
Browse files Browse the repository at this point in the history
…r_error

[19.03 backport] Propagate GetContainer error from event processor
Upstream-commit: 0e8949a003204b63f4c55cb5beb38754efed020c
Component: engine
  • Loading branch information
andrewhsu authored Oct 28, 2019
2 parents 006085f + b6eaafe commit c7ec6e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions components/engine/daemon/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"errors"
"fmt"
"runtime"
"strconv"
"time"
Expand All @@ -12,6 +10,7 @@ import (
"github.com/docker/docker/container"
libcontainerdtypes "github.com/docker/docker/libcontainerd/types"
"github.com/docker/docker/restartmanager"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

Expand All @@ -29,8 +28,8 @@ func (daemon *Daemon) setStateCounter(c *container.Container) {
// ProcessEvent is called by libcontainerd whenever an event occurs
func (daemon *Daemon) ProcessEvent(id string, e libcontainerdtypes.EventType, ei libcontainerdtypes.EventInfo) error {
c, err := daemon.GetContainer(id)
if c == nil || err != nil {
return fmt.Errorf("no such container: %s", id)
if err != nil {
return errors.Wrapf(err, "could not find container %s", id)
}

switch e {
Expand Down

0 comments on commit c7ec6e8

Please sign in to comment.