mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #41641 from cpuguy83/fix_checkpoint
Don't set image on containerd container.
This commit is contained in:
commit
49e809fbfe
1 changed files with 2 additions and 17 deletions
|
@ -5,9 +5,6 @@ import (
|
|||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/containers"
|
||||
"github.com/docker/distribution/reference"
|
||||
"github.com/docker/docker/api/types"
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/container"
|
||||
|
@ -181,12 +178,7 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
|
|||
|
||||
ctx := context.TODO()
|
||||
|
||||
imageRef, err := reference.ParseNormalizedNamed(container.Config.Image)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = daemon.containerd.Create(ctx, container.ID, spec, shim, createOptions, withImageName(imageRef.String()))
|
||||
err = daemon.containerd.Create(ctx, container.ID, spec, shim, createOptions)
|
||||
if err != nil {
|
||||
if errdefs.IsConflict(err) {
|
||||
logrus.WithError(err).WithField("container", container.ID).Error("Container not cleaned up from containerd from previous run")
|
||||
|
@ -195,7 +187,7 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
|
|||
if err := daemon.containerd.Delete(ctx, container.ID); err != nil && !errdefs.IsNotFound(err) {
|
||||
logrus.WithError(err).WithField("container", container.ID).Error("Error cleaning up stale containerd container object")
|
||||
}
|
||||
err = daemon.containerd.Create(ctx, container.ID, spec, shim, createOptions, withImageName(imageRef.String()))
|
||||
err = daemon.containerd.Create(ctx, container.ID, spec, shim, createOptions)
|
||||
}
|
||||
if err != nil {
|
||||
return translateContainerdStartErr(container.Path, container.SetExitCode, err)
|
||||
|
@ -272,10 +264,3 @@ func (daemon *Daemon) Cleanup(container *container.Container) {
|
|||
logrus.Errorf("%s cleanup: failed to delete container from containerd: %v", container.ID, err)
|
||||
}
|
||||
}
|
||||
|
||||
func withImageName(n string) containerd.NewContainerOpts {
|
||||
return func(ctx context.Context, _ *containerd.Client, c *containers.Container) error {
|
||||
c.Image = n
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue