diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-12 22:12:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-12 22:12:21 +0200 |
commit | 62352b280b981db9f8e3bf2d89acf02d212a04cf (patch) | |
tree | aefb868d4b1e32e48d2caf866c4b9848c5c4148f | |
parent | 686da0d60c798d175af729ab27023f6a038be08f (diff) | |
parent | f50f91079a784d2c09f5ac8a3a74dc9b380c94d3 (diff) | |
download | podman-62352b280b981db9f8e3bf2d89acf02d212a04cf.tar.gz podman-62352b280b981db9f8e3bf2d89acf02d212a04cf.tar.bz2 podman-62352b280b981db9f8e3bf2d89acf02d212a04cf.zip |
Merge pull request #3537 from QiWang19/volumeabs
fix bug convert volume host path to absolute
-rw-r--r-- | pkg/spec/storage.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/spec/storage.go b/pkg/spec/storage.go index ed767f5ba..88f1f6dc1 100644 --- a/pkg/spec/storage.go +++ b/pkg/spec/storage.go @@ -211,6 +211,13 @@ func (config *CreateConfig) parseVolumes(runtime *libpod.Runtime) ([]spec.Mount, } mount.Options = opts } + if mount.Type == TypeBind { + absSrc, err := filepath.Abs(mount.Source) + if err != nil { + return nil, nil, errors.Wrapf(err, "error getting absolute path of %s", mount.Source) + } + mount.Source = absSrc + } finalMounts = append(finalMounts, mount) } finalVolumes := make([]*libpod.ContainerNamedVolume, 0, len(baseVolumes)) |