Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap incorrect key and value of BindMounts and VolumeMounts #354

Merged
merged 1 commit into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,14 @@ func (p *DockerProvider) CreateContainer(ctx context.Context, req ContainerReque

// prepare mounts
mounts := []mount.Mount{}
for hostPath, innerPath := range req.BindMounts {
for innerPath, hostPath := range req.BindMounts {
mounts = append(mounts, mount.Mount{
Type: mount.TypeBind,
Source: hostPath,
Target: innerPath,
})
}
for volumeName, innerPath := range req.VolumeMounts {
for innerPath, volumeName := range req.VolumeMounts {
mounts = append(mounts, mount.Mount{
Type: mount.TypeVolume,
Source: volumeName,
Expand Down
4 changes: 2 additions & 2 deletions docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,8 @@ func TestContainerCreationWithBindAndVolume(t *testing.T) {
bashC, err := GenericContainer(ctx, GenericContainerRequest{
ContainerRequest: ContainerRequest{
Image: "bash",
BindMounts: map[string]string{absPath: "/hello.sh"},
VolumeMounts: map[string]string{volumeName: "/data"},
BindMounts: map[string]string{"/hello.sh": absPath},
VolumeMounts: map[string]string{"/data": volumeName},
Cmd: []string{"bash", "/hello.sh"},
WaitingFor: wait.ForLog("done"),
},
Expand Down