diff options
| author | chrislusf <chris.lu@gmail.com> | 2025-12-06 12:13:31 -0800 |
|---|---|---|
| committer | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-06 18:53:22 -0800 |
| commit | 62bd056a3427738f0bebd9ca405d84e29275755b (patch) | |
| tree | ebaae600bb943a0a53f42adcaaba4e4d3a69e62b /pkg | |
| parent | 9c5624a786bf64c22277ff590adb27c2e25e3ae4 (diff) | |
| download | seaweedfs-csi-driver-62bd056a3427738f0bebd9ca405d84e29275755b.tar.xz seaweedfs-csi-driver-62bd056a3427738f0bebd9ca405d84e29275755b.zip | |
fix: address gemini-code-assist review comments
- Change mountService updateStrategy from RollingUpdate to OnDelete
(mount service not yet resilient to its own restarts)
- Change mountService image from :latest to :dev for consistency
- Fix defer os.RemoveAll: explicitly remove cache dir after process stops
to avoid removing while process might still be running
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/mountmanager/manager.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go index e4e4329..1bdeb3e 100644 --- a/pkg/mountmanager/manager.go +++ b/pkg/mountmanager/manager.go @@ -102,12 +102,15 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) { } } - defer os.RemoveAll(entry.cacheDir) - if err := entry.process.stop(); err != nil { return nil, err } + // Remove cache dir only after process has been successfully stopped + if err := os.RemoveAll(entry.cacheDir); err != nil { + glog.Warningf("failed to remove cache dir %s for volume %s: %v", entry.cacheDir, req.VolumeID, err) + } + glog.Infof("stopped weed mount process for volume %s at %s", req.VolumeID, entry.targetPath) return &UnmountResponse{}, nil } |
