summaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-07 17:28:28 -0500
committerGitHub <noreply@github.com>2020-12-07 17:28:28 -0500
commit23d2deed30c2491a2cf59644324f27c9eebf7ba4 (patch)
treee191f6ea97f53e22f9b43e04900fe9df1e65eef9 /cmd/podman/common
parent4c424e845239aef6e8cdab93dc19f55f4314513c (diff)
parent33bde4569ccb65b447150894c56f9a351a09a471 (diff)
downloadpodman-23d2deed30c2491a2cf59644324f27c9eebf7ba4.tar.gz
podman-23d2deed30c2491a2cf59644324f27c9eebf7ba4.tar.bz2
podman-23d2deed30c2491a2cf59644324f27c9eebf7ba4.zip
Merge pull request #8640 from mheon/221_backports
Backports for v2.2.1
Diffstat (limited to 'cmd/podman/common')
-rw-r--r--cmd/podman/common/completion.go8
-rw-r--r--cmd/podman/common/create_opts.go15
2 files changed, 10 insertions, 13 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index 9856e46ef..7fed15e5e 100644
--- a/cmd/podman/common/completion.go
+++ b/cmd/podman/common/completion.go
@@ -861,10 +861,10 @@ func AutocompletePsFilters(cmd *cobra.Command, args []string, toComplete string)
"status=": func(_ string) ([]string, cobra.ShellCompDirective) {
return containerStatuses, cobra.ShellCompDirectiveNoFileComp
},
- "ancestor": func(s string) ([]string, cobra.ShellCompDirective) { return getImages(cmd, s) },
- "before=": func(s string) ([]string, cobra.ShellCompDirective) { return getContainers(cmd, s, completeDefault) },
- "since=": func(s string) ([]string, cobra.ShellCompDirective) { return getContainers(cmd, s, completeDefault) },
- "volume=": func(s string) ([]string, cobra.ShellCompDirective) { return getVolumes(cmd, s) },
+ "ancestor=": func(s string) ([]string, cobra.ShellCompDirective) { return getImages(cmd, s) },
+ "before=": func(s string) ([]string, cobra.ShellCompDirective) { return getContainers(cmd, s, completeDefault) },
+ "since=": func(s string) ([]string, cobra.ShellCompDirective) { return getContainers(cmd, s, completeDefault) },
+ "volume=": func(s string) ([]string, cobra.ShellCompDirective) { return getVolumes(cmd, s) },
"health=": func(_ string) ([]string, cobra.ShellCompDirective) {
return []string{define.HealthCheckHealthy,
define.HealthCheckUnhealthy}, cobra.ShellCompDirectiveNoFileComp
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 6dc43dbc6..a20ac9d78 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -203,20 +203,14 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup
for _, m := range cc.HostConfig.Mounts {
mount := fmt.Sprintf("type=%s", m.Type)
if len(m.Source) > 0 {
- mount += fmt.Sprintf("source=%s", m.Source)
+ mount += fmt.Sprintf(",source=%s", m.Source)
}
if len(m.Target) > 0 {
- mount += fmt.Sprintf("dest=%s", m.Target)
+ mount += fmt.Sprintf(",dst=%s", m.Target)
}
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 {