diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-01 21:12:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 21:12:20 +0100 |
commit | 737e1d1994465538e4f9bd8cbd7dbe4ffcd72065 (patch) | |
tree | 621938c2f564be9567648cbf4b4116de55ccee4b /cmd | |
parent | 8ffb0ae65955f1d233cbf027852c6b2ed68054c2 (diff) | |
parent | c562e8b8da7ff6e4ae93cb6a6d0daa1d2126be08 (diff) | |
download | podman-737e1d1994465538e4f9bd8cbd7dbe4ffcd72065.tar.gz podman-737e1d1994465538e4f9bd8cbd7dbe4ffcd72065.tar.bz2 podman-737e1d1994465538e4f9bd8cbd7dbe4ffcd72065.zip |
Merge pull request #8540 from baude/compatecreatevols
compat create should use bindings
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/common/create_opts.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index 6dc43dbc6..41611d1aa 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -211,12 +211,6 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup mounts = append(mounts, mount) } - // volumes - volumes := make([]string, 0, len(cc.Config.Volumes)) - for v := range cc.Config.Volumes { - volumes = append(volumes, v) - } - // dns dns := make([]net.IP, 0, len(cc.HostConfig.DNS)) for _, d := range cc.HostConfig.DNS { @@ -373,7 +367,6 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup UserNS: string(cc.HostConfig.UsernsMode), UTS: string(cc.HostConfig.UTSMode), Mount: mounts, - Volume: volumes, VolumesFrom: cc.HostConfig.VolumesFrom, Workdir: cc.Config.WorkingDir, Net: &netInfo, @@ -388,6 +381,10 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup } } + // volumes + if volumes := cc.HostConfig.Binds; len(volumes) > 0 { + cliOpts.Volume = volumes + } if len(cc.HostConfig.BlkioWeightDevice) > 0 { devices := make([]string, 0, len(cc.HostConfig.BlkioWeightDevice)) for _, d := range cc.HostConfig.BlkioWeightDevice { |