summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-12-01 12:28:52 -0600
committerbaude <bbaude@redhat.com>2020-12-01 12:28:52 -0600
commitc562e8b8da7ff6e4ae93cb6a6d0daa1d2126be08 (patch)
tree8eff40932b350570d1ad3224d99322ed32ff2e8f /cmd/podman
parent429d9492f85faf4c3a595b9d7b2a38743a4b8e42 (diff)
downloadpodman-c562e8b8da7ff6e4ae93cb6a6d0daa1d2126be08.tar.gz
podman-c562e8b8da7ff6e4ae93cb6a6d0daa1d2126be08.tar.bz2
podman-c562e8b8da7ff6e4ae93cb6a6d0daa1d2126be08.zip
compat create should use bindings
the volumes provided is seemingly useless representing what volumes should be added to a container. instead, the host config bindings should be used as they acurately describe the src/dest and options for bindings. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/create_opts.go11
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 {