Description
Problem
This issue is related to #29555 which was fixed by PR #29673. That issue fixed name collisions for non-attachable volumes (which is much more common), but not for attachable volumes.
Specifically, if a single pod references the same attachable disk via two different volume names (possibly to refer to different partitions), the names will collide.
Suggested Fix
There are three main volumemanager
data structures:
- Actual State of the World (ASW)
- Desired State of the World (DSW)
- Nested Pending Operations (formerly goroutinemap)
Instead of using the same key (unique volume name) for all these data structs, the key for ASW and DSW should be a struct that includes unique volume name and unique pod name. Nested pending operations can continue to operate on unique volume name to keep the existing protection against multiple operations on the same volume.
Suggested Cleanup
Move GetVolumeName()
to Attacher
volumes interface (instead of required for all volumes). With PR #29673 non-attachable volumes auto-generate the volume name. Ensure that MarkVolumeAsAttached()
has all the information it needs to either generate the name in either case (instead of passing in an override).