From 8563e55e8d307f32b90e6f5676fe7fe1dc0c3459 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Mon, 12 Aug 2024 12:36:09 -0400 Subject: [PATCH] UPSTREAM: 126641: e1e/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 --- test/e2e/storage/volume_metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/storage/volume_metrics.go b/test/e2e/storage/volume_metrics.go index 0ad173bd4dab5..1e8f3b9bebc9c 100644 --- a/test/e2e/storage/volume_metrics.go +++ b/test/e2e/storage/volume_metrics.go @@ -283,7 +283,7 @@ var _ = utils.SIGDescribe(framework.WithSerial(), "Volume metrics", func() { pod := makePod(f, pvcBlock, isEphemeral) pod.Spec.Containers[0].VolumeDevices = []v1.VolumeDevice{{ Name: pod.Spec.Volumes[0].Name, - DevicePath: "/mnt/" + pvcBlock.Name, + DevicePath: "/mnt/" + pod.Spec.Volumes[0].Name, }} pod.Spec.Containers[0].VolumeMounts = nil pod, err = c.CoreV1().Pods(ns).Create(ctx, pod, metav1.CreateOptions{})