mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
csi: fix CSI ExpandVolume stagingPath (#25253)
Fix the checking of the staging path against the mountRoot on the host rather then checking against the containerMountPoint which (probably) never exists on the host causing it to default back the the legacy behaviour.
This commit is contained in:
3
.changelog/25253.txt
Normal file
3
.changelog/25253.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
csi: Fixed a CSI ExpandVolume bug where the namespace was left out of the staging path
|
||||
```
|
||||
@@ -293,7 +293,7 @@ func (v *volumeManager) unstageVolume(ctx context.Context, volNS, volID, remoteI
|
||||
// plugin to perform unstaging
|
||||
stagingPath := v.stagingDirForVolume(v.containerMountPoint, volNS, volID, usage)
|
||||
|
||||
// This it the path from the host, which we need to use to verify whether
|
||||
// This is the path from the host, which we need to use to verify whether
|
||||
// the path is the right one to pass to the plugin container
|
||||
hostStagingPath := v.stagingDirForVolume(v.mountRoot, volNS, volID, usage)
|
||||
_, err := os.Stat(hostStagingPath)
|
||||
@@ -416,8 +416,14 @@ func (v *volumeManager) ExpandVolume(ctx context.Context, volNS, volID, remoteID
|
||||
"volume_id", volID, "alloc_id", allocID, "error", err)
|
||||
}
|
||||
|
||||
// This is the staging path inside the container, which we pass to the
|
||||
// plugin to perform expansion
|
||||
stagingPath := v.stagingDirForVolume(v.containerMountPoint, volNS, volID, usage)
|
||||
_, err = os.Stat(stagingPath)
|
||||
|
||||
// This is the path from the host, which we need to use to verify whether
|
||||
// the path is the right one to pass to the plugin container
|
||||
hostStagingPath := v.stagingDirForVolume(v.mountRoot, volNS, volID, usage)
|
||||
_, err = os.Stat(hostStagingPath)
|
||||
if err != nil && errors.Is(err, fs.ErrNotExist) {
|
||||
// COMPAT: it's possible to get an unmount request that includes the
|
||||
// namespace even for volumes that were mounted before the path included
|
||||
|
||||
Reference in New Issue
Block a user