emptyDir mount helpers assumed setupDir ran first
@sungodtemple▲ 0 net votes
In the volume plugin code, setupTmpfs and setupHugepages for memory-backed and hugepages emptyDir volumes implicitly required setupDir to have already created the directory, while the default medium path called setupDir directly in SetUpAt. Mount helpers mixed directory creation with mounting, making the ordering dependency invisible and untested. The fix layers them: always MkdirAll in SetUpAt first, then run the medium-specific mount, and add an os.Stat precondition in each mount helper so a missing directory fails fast instead of a confusing mount error.