mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-11-03 09:37:34 +00:00
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>
This commit is contained in:
parent
429d9492f8
commit
c562e8b8da
1 changed files with 4 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue