getNestedMountpoints may not group mountpoints correctly #112570
Labels
kind/bug
Categorizes issue or PR as related to a bug.
sig/windows
Categorizes an issue or PR as relevant to SIG Windows.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Milestone
What happened?
getNestedMountpoints
[1] relies onsort.Strings
to have all the mount points sorted and grouped. For example, the following strings are sorted in this exact order:With the current implementation,
getNestedMountpoints
, an incorrect set of nested directories would be returned. For example, if we add thenested-vol
andnested.vol
volume mounts into theTestGetNestedMountpoints/Unsorted Nested Pod
test, we would get:This is worse on Windows, where paths usually have backslashes instead (with no test changes):
[1]
kubernetes/pkg/volume/util/nested_volumes.go
Line 33 in 64a38b1
What did you expect to happen?
getNestedMountpoints
should group mount points correctly.How can we reproduce it (as minimally and precisely as possible)?
Anything else we need to know?
/kind bug
/sig windows
Kubernetes version
Kubernetes master, Kubernetes v1.25 and older.
Cloud provider
N/A
OS version
N/A
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: