aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislusf <chris.lu@gmail.com>2025-12-06 12:46:48 -0800
committerchrislusf <chris.lu@gmail.com>2025-12-06 12:47:08 -0800
commit8f23e49cec62a487204faabc13e02ae4b1a080cd (patch)
treea5c25bf18e56edc7a35ca9a826836fd79952a14e
parentaea7488f8c0808fc02db648680d8b9fd588443ed (diff)
downloadseaweedfs-csi-driver-8f23e49cec62a487204faabc13e02ae4b1a080cd.tar.xz
seaweedfs-csi-driver-8f23e49cec62a487204faabc13e02ae4b1a080cd.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
-rw-r--r--deploy/kubernetes/seaweedfs-csi.yaml6
-rw-r--r--pkg/mountmanager/manager.go13
2 files changed, 10 insertions, 9 deletions
diff --git a/deploy/kubernetes/seaweedfs-csi.yaml b/deploy/kubernetes/seaweedfs-csi.yaml
index 41062e1..a1ce033 100644
--- a/deploy/kubernetes/seaweedfs-csi.yaml
+++ b/deploy/kubernetes/seaweedfs-csi.yaml
@@ -216,7 +216,7 @@ spec:
add:
- SYS_ADMIN
privileged: true
- image: chrislusf/seaweedfs-csi-driver:dev
+ image: chrislusf/seaweedfs-csi-driver:latest
imagePullPolicy: IfNotPresent
args:
- --endpoint=$(CSI_ENDPOINT)
@@ -375,7 +375,7 @@ spec:
add:
- SYS_ADMIN
privileged: true
- image: chrislusf/seaweedfs-mount:dev
+ image: chrislusf/seaweedfs-mount:latest
imagePullPolicy: IfNotPresent
args:
- --endpoint=$(MOUNT_ENDPOINT)
@@ -444,7 +444,7 @@ spec:
containers:
# SeaweedFs Plugin (controller)
- name: seaweedfs-csi-plugin
- image: chrislusf/seaweedfs-csi-driver:dev
+ image: chrislusf/seaweedfs-csi-driver:latest
imagePullPolicy: IfNotPresent
args :
- --endpoint=$(CSI_ENDPOINT)
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)
}
}