Fix index out of range on compose.buildContainerMountOptions

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
Ulysses Souza 2021-10-05 09:16:44 +02:00
parent ea5b094a93
commit 7d768e7c1d
1 changed files with 4 additions and 4 deletions

View File

@ -126,12 +126,12 @@ func TestBuildContainerMountOptions(t *testing.T) {
mounts, err := buildContainerMountOptions(project, project.Services[0], moby.ImageInspect{}, inherit)
assert.NilError(t, err)
assert.Assert(t, len(mounts) == 2)
assert.Assert(t, mounts[0].Target == "/var/myvolume1")
assert.Assert(t, mounts[1].Target == "/var/myvolume2")
assert.Equal(t, mounts[0].Target, "/var/myvolume1")
assert.Equal(t, mounts[1].Target, "/var/myvolume2")
mounts, err = buildContainerMountOptions(project, project.Services[0], moby.ImageInspect{}, inherit)
assert.NilError(t, err)
assert.Assert(t, len(mounts) == 2)
assert.Assert(t, mounts[0].Target == "/var/myvolume1")
assert.Assert(t, mounts[1].Target == "/var/myvolume2")
assert.Equal(t, mounts[0].Target, "/var/myvolume1")
assert.Equal(t, mounts[1].Target, "/var/myvolume2")
}