Skip to content

Commit 41e6162

Browse files
committed
e2e/storage: update block device test to always specify a valid path
in the isEphemeral case, the pvcBlock doesn't have a filled in name, which means the DevicePath is "/mnt". When using the OCI runtime runc, this is valid because runc sanitizes the path, mounting it in `/mnt` in the container. However, the OCI runtime crun does not do this. One can argue the validity of passing a path structured like a directory as a block device, but ultimately from what I can see this wasn't intentional. As such, fix it by setting the mount to be based on the first Volume name, which both cases should have filled out. Signed-off-by: Peter Hunt <[email protected]>
1 parent 60c4c2b commit 41e6162

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/e2e/storage/volume_metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ var _ = utils.SIGDescribe(framework.WithSerial(), "Volume metrics", func() {
285285
pod := makePod(f, pvcBlock, isEphemeral)
286286
pod.Spec.Containers[0].VolumeDevices = []v1.VolumeDevice{{
287287
Name: pod.Spec.Volumes[0].Name,
288-
DevicePath: "/mnt/" + pvcBlock.Name,
288+
DevicePath: "/mnt/" + pod.Spec.Volumes[0].Name,
289289
}}
290290
pod.Spec.Containers[0].VolumeMounts = nil
291291
pod, err = c.CoreV1().Pods(ns).Create(ctx, pod, metav1.CreateOptions{})

0 commit comments

Comments
 (0)