Skip to content

Commit

Permalink
UPSTREAM: 126641: e1e/storage: update block device test to always spe…
Browse files Browse the repository at this point in the history
…cify 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]>
  • Loading branch information
haircommander committed Aug 19, 2024
1 parent b2fd74b commit 8563e55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/storage/volume_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit 8563e55

Please sign in to comment.