diff options
Diffstat (limited to 'pkg/v1/utils/volumes_test.go')
-rw-r--r-- | pkg/v1/utils/volumes_test.go | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/pkg/v1/utils/volumes_test.go b/pkg/v1/utils/volumes_test.go index 8e7d4a940..8a6a30ef1 100644 --- a/pkg/v1/utils/volumes_test.go +++ b/pkg/v1/utils/volumes_test.go @@ -103,7 +103,7 @@ func TestUpdateVolumeAnnotations(t *testing.T) { expectUpdate: true, }, { - desc: "volume annotations for container", + desc: "tmpfs: volume annotations for container", spec: &specs.Spec{ Mounts: []specs.Mount{ { @@ -151,6 +151,42 @@ func TestUpdateVolumeAnnotations(t *testing.T) { expectUpdate: true, }, { + desc: "bind: volume annotations for container", + spec: &specs.Spec{ + Mounts: []specs.Mount{ + { + Destination: "/test", + Type: "bind", + Source: testVolumePath, + Options: []string{"ro"}, + }, + }, + Annotations: map[string]string{ + annotations.ContainerType: annotations.ContainerTypeContainer, + "gvisor.dev/spec/mount/" + testVolumeName + "/share": "container", + "gvisor.dev/spec/mount/" + testVolumeName + "/type": "bind", + "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + }, + }, + expected: &specs.Spec{ + Mounts: []specs.Mount{ + { + Destination: "/test", + Type: "bind", + Source: testVolumePath, + Options: []string{"ro"}, + }, + }, + Annotations: map[string]string{ + annotations.ContainerType: annotations.ContainerTypeContainer, + "gvisor.dev/spec/mount/" + testVolumeName + "/share": "container", + "gvisor.dev/spec/mount/" + testVolumeName + "/type": "bind", + "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + }, + }, + expectUpdate: true, + }, + { desc: "should not return error without pod log directory", spec: &specs.Spec{ Annotations: map[string]string{ |