summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-10-09 09:45:21 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2018-10-14 16:57:29 +0200
commit2ad6012ea1943cb045ebc1a7071c9a9a61538d11 (patch)
tree7aca463f74a8a921b46485532be7061ade8b4778
parent56919385638af225fb31195d2dbdd02a0360dea6 (diff)
downloadpodman-2ad6012ea1943cb045ebc1a7071c9a9a61538d11.tar.gz
podman-2ad6012ea1943cb045ebc1a7071c9a9a61538d11.tar.bz2
podman-2ad6012ea1943cb045ebc1a7071c9a9a61538d11.zip
volume: write the correct ID of the container in error messages
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--libpod/container_internal.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index ab79aa790..0a17996d6 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1212,28 +1212,28 @@ func (c *Container) addLocalVolumes(ctx context.Context, g *generate.Generator)
if _, err := os.Stat(srcPath); os.IsNotExist(err) {
logrus.Infof("Volume image mount point %s does not exist in root FS, need to create it", k)
if err = os.MkdirAll(srcPath, 0755); err != nil {
- return errors.Wrapf(err, "error creating directory %q for volume %q in container %q", volumePath, k, c.ID)
+ return errors.Wrapf(err, "error creating directory %q for volume %q in container %q", volumePath, k, c.ID())
}
if err = os.Chown(srcPath, int(uid), int(gid)); err != nil {
- return errors.Wrapf(err, "error chowning directory %q for volume %q in container %q", srcPath, k, c.ID)
+ return errors.Wrapf(err, "error chowning directory %q for volume %q in container %q", srcPath, k, c.ID())
}
}
if _, err := os.Stat(volumePath); os.IsNotExist(err) {
if err = os.MkdirAll(volumePath, 0755); err != nil {
- return errors.Wrapf(err, "error creating directory %q for volume %q in container %q", volumePath, k, c.ID)
+ return errors.Wrapf(err, "error creating directory %q for volume %q in container %q", volumePath, k, c.ID())
}
if err = os.Chown(volumePath, int(uid), int(gid)); err != nil {
- return errors.Wrapf(err, "error chowning directory %q for volume %q in container %q", volumePath, k, c.ID)
+ return errors.Wrapf(err, "error chowning directory %q for volume %q in container %q", volumePath, k, c.ID())
}
if err = label.Relabel(volumePath, c.config.MountLabel, false); err != nil {
- return errors.Wrapf(err, "error relabeling directory %q for volume %q in container %q", volumePath, k, c.ID)
+ return errors.Wrapf(err, "error relabeling directory %q for volume %q in container %q", volumePath, k, c.ID())
}
if err = chrootarchive.NewArchiver(nil).CopyWithTar(srcPath, volumePath); err != nil && !os.IsNotExist(err) {
- return errors.Wrapf(err, "error populating directory %q for volume %q in container %q using contents of %q", volumePath, k, c.ID, srcPath)
+ return errors.Wrapf(err, "error populating directory %q for volume %q in container %q using contents of %q", volumePath, k, c.ID(), srcPath)
}
// Set the volume path with the same owner and permission of source path