mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #39497 from cpuguy83/better_container_error
Propagate GetContainer error from event processor
This commit is contained in:
commit
78deb9863f
1 changed files with 3 additions and 4 deletions
|
@ -2,8 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"time"
|
||||
|
@ -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"
|
||||
)
|
||||
|
||||
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue