diff options
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 514cdaee1..2f107446f 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -835,13 +835,13 @@ func (c *Container) checkpointRestoreLabelLog(fileName string) error { logFile, err := os.OpenFile(dumpLog, os.O_CREATE, 0600) if err != nil { - return errors.Wrapf(err, "failed to create CRIU log file %q", dumpLog) + return errors.Wrap(err, "failed to create CRIU log file") } if err := logFile.Close(); err != nil { - logrus.Errorf("unable to close log file: %q", err) + logrus.Error(err) } if err = label.SetFileLabel(dumpLog, c.MountLabel()); err != nil { - return errors.Wrapf(err, "failed to label CRIU log file %q", dumpLog) + return err } return nil } @@ -919,7 +919,7 @@ func (c *Container) checkpoint(ctx context.Context, options ContainerCheckpointO func (c *Container) importCheckpoint(input string) error { archiveFile, err := os.Open(input) if err != nil { - return errors.Wrapf(err, "Failed to open checkpoint archive %s for import", input) + return errors.Wrap(err, "Failed to open checkpoint archive for import") } defer archiveFile.Close() @@ -1116,7 +1116,7 @@ func (c *Container) restore(ctx context.Context, options ContainerCheckpointOpti // Only do this if a rootfs-diff.tar actually exists rootfsDiffFile, err := os.Open(rootfsDiffPath) if err != nil { - return errors.Wrapf(err, "Failed to open root file-system diff file %s", rootfsDiffPath) + return errors.Wrap(err, "Failed to open root file-system diff file") } defer rootfsDiffFile.Close() if err := c.runtime.ApplyDiffTarStream(c.ID(), rootfsDiffFile); err != nil { @@ -1125,16 +1125,10 @@ func (c *Container) restore(ctx context.Context, options ContainerCheckpointOpti } deletedFilesPath := filepath.Join(c.bundlePath(), "deleted.files") if _, err := os.Stat(deletedFilesPath); err == nil { - deletedFilesFile, err := os.Open(deletedFilesPath) - if err != nil { - return errors.Wrapf(err, "Failed to open deleted files file %s", deletedFilesPath) - } - defer deletedFilesFile.Close() - var deletedFiles []string - deletedFilesJSON, err := ioutil.ReadAll(deletedFilesFile) + deletedFilesJSON, err := ioutil.ReadFile(deletedFilesPath) if err != nil { - return errors.Wrapf(err, "Failed to read deleted files file %s", deletedFilesPath) + return errors.Wrapf(err, "Failed to read deleted files file") } if err := json.Unmarshal(deletedFilesJSON, &deletedFiles); err != nil { return errors.Wrapf(err, "Failed to read deleted files file %s", deletedFilesPath) |