summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-24 17:04:26 +0200
committerGitHub <noreply@github.com>2020-07-24 17:04:26 +0200
commit417cc413981369b0156a7f0ad49081b2a924597e (patch)
tree69f3b2fe78855e07f44084da306c6d84b091222c /pkg
parent22b1483902ed17fa6b0fd778575088be257800c2 (diff)
parent9fe3153c0c8c7aba80975b6e080935d40198e7c9 (diff)
downloadpodman-417cc413981369b0156a7f0ad49081b2a924597e.tar.gz
podman-417cc413981369b0156a7f0ad49081b2a924597e.tar.bz2
podman-417cc413981369b0156a7f0ad49081b2a924597e.zip
Merge pull request #6742 from maybe-sybr/maybe/apiv2/fix-container-create-with-volumes
APIv2:fix: Get volumes from `Binds` when creating
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/containers_create.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go
index 4ad6aa862..cbcda474a 100644
--- a/pkg/api/handlers/compat/containers_create.go
+++ b/pkg/api/handlers/compat/containers_create.go
@@ -159,10 +159,10 @@ func makeCreateConfig(ctx context.Context, containerConfig *config.Config, input
User: input.User,
}
pidConfig := createconfig.PidConfig{PidMode: namespaces.PidMode(input.HostConfig.PidMode)}
- volumes := make([]string, 0, len(input.Volumes))
- for k := range input.Volumes {
- volumes = append(volumes, k)
- }
+ // TODO: We should check that these binds are all listed in the `Volumes`
+ // key since it doesn't make sense to define a `Binds` element for a
+ // container path which isn't defined as a volume
+ volumes := input.HostConfig.Binds
// Docker is more flexible about its input where podman throws
// away incorrectly formatted variables so we cannot reuse the