remove Register return value
Since Register() will never return err,remove the return value Signed-off-by: NickrenREN <yuquan.ren@easystack.cn>
This commit is contained in:
parent
4af2555a35
commit
78b50c129e
3 changed files with 3 additions and 11 deletions
|
@ -88,7 +88,7 @@ func (daemon *Daemon) load(id string) (*container.Container, error) {
|
|||
}
|
||||
|
||||
// Register makes a container object usable by the daemon as <container.ID>
|
||||
func (daemon *Daemon) Register(c *container.Container) error {
|
||||
func (daemon *Daemon) Register(c *container.Container) {
|
||||
// Attach to stdout and stderr
|
||||
if c.Config.OpenStdin {
|
||||
c.StreamConfig.NewInputPipes()
|
||||
|
@ -98,8 +98,6 @@ func (daemon *Daemon) Register(c *container.Container) error {
|
|||
|
||||
daemon.containers.Add(c.ID, c)
|
||||
daemon.idIndex.Add(c.ID)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (daemon *Daemon) newContainer(name string, config *containertypes.Config, hostConfig *containertypes.HostConfig, imgID image.ID, managed bool) (*container.Container, error) {
|
||||
|
|
|
@ -151,9 +151,7 @@ func (daemon *Daemon) create(params types.ContainerCreateConfig, managed bool) (
|
|||
logrus.Errorf("Error saving new container to disk: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
if err := daemon.Register(container); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
daemon.Register(container)
|
||||
daemon.LogContainerEvent(container, "create")
|
||||
return container, nil
|
||||
}
|
||||
|
|
|
@ -168,11 +168,7 @@ func (daemon *Daemon) restore() error {
|
|||
delete(containers, id)
|
||||
continue
|
||||
}
|
||||
if err := daemon.Register(c); err != nil {
|
||||
logrus.Errorf("Failed to register container %s: %s", c.ID, err)
|
||||
delete(containers, id)
|
||||
continue
|
||||
}
|
||||
daemon.Register(c)
|
||||
|
||||
// verify that all volumes valid and have been migrated from the pre-1.7 layout
|
||||
if err := daemon.verifyVolumesInfo(c); err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue