Merge pull request #463 from Random-Liu/dump-rootfs

Check and dump rootfs.
This commit is contained in:
Mike Brown
2017-12-03 09:23:04 -06:00
committed by GitHub
4 changed files with 196 additions and 0 deletions

View File

@@ -128,6 +128,19 @@ func (c *criContainerdService) startContainer(ctx context.Context,
task, err := container.NewTask(ctx, ioCreation)
if err != nil {
glog.V(0).Infof("Check snapshot %q after start failure", id)
glog.V(0).Infof("Check image %q after start failure", cntr.ImageRef)
spec, err := container.Spec(ctx)
if err != nil {
glog.Errorf("Failed to get container %q spec: %v", id, err)
} else {
if err := c.checkSnapshot(ctx, id, spec.Process.Args[0], spec.Process.Env, true); err != nil {
glog.Errorf("Failed to check snapshot %q: %v", id, err)
}
if err := c.checkImage(ctx, cntr.ImageRef, spec.Process.Args[0], spec.Process.Env, true); err != nil {
glog.Errorf("Failed to check image %q: %v", cntr.ImageRef, err)
}
}
return fmt.Errorf("failed to create containerd task: %v", err)
}
defer func() {