diff options
Diffstat (limited to 'pkg/v1/utils/volumes_test.go')
-rw-r--r-- | pkg/v1/utils/volumes_test.go | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/pkg/v1/utils/volumes_test.go b/pkg/v1/utils/volumes_test.go index 8a6a30ef1..472cd6e86 100644 --- a/pkg/v1/utils/volumes_test.go +++ b/pkg/v1/utils/volumes_test.go @@ -62,19 +62,19 @@ func TestUpdateVolumeAnnotations(t *testing.T) { Annotations: map[string]string{ annotations.SandboxLogDir: testLogDirPath, annotations.ContainerType: annotations.ContainerTypeSandbox, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, expected: &specs.Spec{ Annotations: map[string]string{ annotations.SandboxLogDir: testLogDirPath, annotations.ContainerType: annotations.ContainerTypeSandbox, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", - "gvisor.dev/spec/mount/" + testVolumeName + "/source": testVolumePath, + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".source": testVolumePath, }, }, expectUpdate: true, @@ -85,19 +85,19 @@ func TestUpdateVolumeAnnotations(t *testing.T) { Annotations: map[string]string{ annotations.SandboxLogDir: testLegacyLogDirPath, annotations.ContainerType: annotations.ContainerTypeSandbox, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, expected: &specs.Spec{ Annotations: map[string]string{ annotations.SandboxLogDir: testLegacyLogDirPath, annotations.ContainerType: annotations.ContainerTypeSandbox, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", - "gvisor.dev/spec/mount/" + testVolumeName + "/source": testVolumePath, + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".source": testVolumePath, }, }, expectUpdate: true, @@ -121,9 +121,9 @@ func TestUpdateVolumeAnnotations(t *testing.T) { }, Annotations: map[string]string{ annotations.ContainerType: annotations.ContainerTypeContainer, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, expected: &specs.Spec{ @@ -143,9 +143,9 @@ func TestUpdateVolumeAnnotations(t *testing.T) { }, Annotations: map[string]string{ annotations.ContainerType: annotations.ContainerTypeContainer, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, expectUpdate: true, @@ -163,9 +163,9 @@ func TestUpdateVolumeAnnotations(t *testing.T) { }, 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", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "container", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "bind", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, expected: &specs.Spec{ @@ -179,9 +179,9 @@ func TestUpdateVolumeAnnotations(t *testing.T) { }, 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", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "container", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "bind", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, expectUpdate: true, @@ -191,17 +191,17 @@ func TestUpdateVolumeAnnotations(t *testing.T) { spec: &specs.Spec{ Annotations: map[string]string{ annotations.ContainerType: annotations.ContainerTypeSandbox, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, expected: &specs.Spec{ Annotations: map[string]string{ annotations.ContainerType: annotations.ContainerTypeSandbox, - "gvisor.dev/spec/mount/" + testVolumeName + "/share": "pod", - "gvisor.dev/spec/mount/" + testVolumeName + "/type": "tmpfs", - "gvisor.dev/spec/mount/" + testVolumeName + "/options": "ro", + "dev.gvisor.spec.mount." + testVolumeName + ".share": "pod", + "dev.gvisor.spec.mount." + testVolumeName + ".type": "tmpfs", + "dev.gvisor.spec.mount." + testVolumeName + ".options": "ro", }, }, }, @@ -211,9 +211,9 @@ func TestUpdateVolumeAnnotations(t *testing.T) { Annotations: map[string]string{ annotations.SandboxLogDir: testLogDirPath, annotations.ContainerType: annotations.ContainerTypeSandbox, - "gvisor.dev/spec/mount/notexist/share": "pod", - "gvisor.dev/spec/mount/notexist/type": "tmpfs", - "gvisor.dev/spec/mount/notexist/options": "ro", + "dev.gvisor.spec.mount.notexist.share": "pod", + "dev.gvisor.spec.mount.notexist.type": "tmpfs", + "dev.gvisor.spec.mount.notexist.options": "ro", }, }, expectErr: true, |