diff options
| author | chrislusf <chris.lu@gmail.com> | 2025-12-06 12:46:48 -0800 |
|---|---|---|
| committer | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-06 18:53:22 -0800 |
| commit | 2cca70371bb9ffaff34aa0adb8f5f12ec442f002 (patch) | |
| tree | a5c25bf18e56edc7a35ca9a826836fd79952a14e /pkg | |
| parent | b9c9efcf507a8b58c05e6439d6efd68f0c6b6f88 (diff) | |
| download | seaweedfs-csi-driver-2cca70371bb9ffaff34aa0adb8f5f12ec442f002.tar.xz seaweedfs-csi-driver-2cca70371bb9ffaff34aa0adb8f5f12ec442f002.zip | |
fix: use :latest tag and replace deprecated IsMountPoint
- Change image tags from :dev to :latest in seaweedfs-csi.yaml for
predictable production deployments
- Replace deprecated IsMountPoint with IsLikelyNotMountPoint for
consistency with k8s.io/mount-utils recommendations
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/mountmanager/manager.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go index 7d6a908..67b29a4 100644 --- a/pkg/mountmanager/manager.go +++ b/pkg/mountmanager/manager.go @@ -172,22 +172,23 @@ func (m *Manager) startMount(req *MountRequest) (*mountEntry, error) { } func ensureTargetClean(targetPath string) error { - isMount, err := kubeMounter.IsMountPoint(targetPath) + // Use IsLikelyNotMountPoint instead of deprecated IsMountPoint + notMnt, err := kubeMounter.IsLikelyNotMountPoint(targetPath) if err != nil { if os.IsNotExist(err) { // Path does not exist, which is a clean state. Directory will be created below. } else if mount.IsCorruptedMnt(err) { glog.Warningf("Target path %s is a corrupted mount, attempting to unmount", targetPath) - if err := kubeMounter.Unmount(targetPath); err != nil { - return fmt.Errorf("failed to unmount corrupted mount %s: %w", targetPath, err) + if unmountErr := kubeMounter.Unmount(targetPath); unmountErr != nil { + return fmt.Errorf("failed to unmount corrupted mount %s: %w", targetPath, unmountErr) } } else { return err } - } else if isMount { + } else if !notMnt { glog.Infof("Target path %s is an existing mount, attempting to unmount", targetPath) - if err := kubeMounter.Unmount(targetPath); err != nil { - return fmt.Errorf("failed to unmount existing mount %s: %w", targetPath, err) + if unmountErr := kubeMounter.Unmount(targetPath); unmountErr != nil { + return fmt.Errorf("failed to unmount existing mount %s: %w", targetPath, unmountErr) } } |
