aboutsummaryrefslogtreecommitdiff
path: root/pkg/mountmanager/socket.go
diff options
context:
space:
mode:
authorchrislusf <chris.lu@gmail.com>2025-12-05 18:44:43 -0800
committerChris Lu <chrislusf@users.noreply.github.com>2025-12-06 18:53:22 -0800
commitf292fb147fb04f857596a0c7bd2ddfef788e52e2 (patch)
tree46acc28e48c10bd9967b6147227e0b8f2c1791e2 /pkg/mountmanager/socket.go
parentd9a69c414e5050183df1e3174553a931e8dae064 (diff)
downloadseaweedfs-csi-driver-f292fb147fb04f857596a0c7bd2ddfef788e52e2.tar.xz
seaweedfs-csi-driver-f292fb147fb04f857596a0c7bd2ddfef788e52e2.zip
fix: address code review feedback
- CRITICAL: Make socket path configurable based on mountEndpoint - Added volumeSocketDir field to SeaweedFsDriver - LocalSocketPath now accepts baseDir parameter - Derived from mountEndpoint for user-configurable socket paths - HIGH: Pin seaweedfs version in Dockerfiles for reproducible builds - Added SEAWEEDFS_VERSION build arg (default: 3.80) - Clone specific tag instead of master - HIGH: Fix Dockerfile.dev to use local context instead of personal fork - Removed hardcoded zemul/seaweedfs-csi-driver clone - Now uses COPY . . for local development - HIGH: Change :latest to :dev in kubernetes manifests - Mutable :latest tag replaced with :dev for predictability - MEDIUM: Remove Aliyun mirror from Dockerfile.dev - Region-specific mirrors shouldn't be in general-purpose files - MEDIUM: Improve error handling in client.go - Now reports read errors when failing to read error response body - MEDIUM: Fix inconsistent error return in manager.go - Return nil instead of empty struct on error (Go idiom)
Diffstat (limited to 'pkg/mountmanager/socket.go')
-rw-r--r--pkg/mountmanager/socket.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/mountmanager/socket.go b/pkg/mountmanager/socket.go
index 1b8a079..f327dcb 100644
--- a/pkg/mountmanager/socket.go
+++ b/pkg/mountmanager/socket.go
@@ -2,15 +2,23 @@ package mountmanager
import (
"fmt"
+ "path/filepath"
"github.com/seaweedfs/seaweedfs/weed/util"
)
+// DefaultSocketDir is the default directory for volume sockets.
+const DefaultSocketDir = "/var/lib/seaweedfs-mount"
+
// LocalSocketPath returns the unix socket path used to communicate with the weed mount process.
-func LocalSocketPath(volumeID string) string {
+// The baseDir parameter should be the directory where sockets are stored (e.g., derived from mountEndpoint).
+func LocalSocketPath(baseDir, volumeID string) string {
+ if baseDir == "" {
+ baseDir = DefaultSocketDir
+ }
hash := util.HashToInt32([]byte(volumeID))
if hash < 0 {
hash = -hash
}
- return fmt.Sprintf("/var/lib/seaweedfs-mount/seaweedfs-mount-%d.sock", hash)
+ return filepath.Join(baseDir, fmt.Sprintf("seaweedfs-mount-%d.sock", hash))
}