From f292fb147fb04f857596a0c7bd2ddfef788e52e2 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Fri, 5 Dec 2025 18:44:43 -0800 Subject: 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) --- pkg/mountmanager/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/mountmanager/client.go') diff --git a/pkg/mountmanager/client.go b/pkg/mountmanager/client.go index 6288c44..7cbfe63 100644 --- a/pkg/mountmanager/client.go +++ b/pkg/mountmanager/client.go @@ -85,7 +85,10 @@ func (c *Client) doPost(path string, payload any, out any) error { if err := json.NewDecoder(resp.Body).Decode(&errResp); err == nil && errResp.Error != "" { return errors.New(errResp.Error) } - data, _ := io.ReadAll(resp.Body) + data, readErr := io.ReadAll(resp.Body) + if readErr != nil { + return fmt.Errorf("mount service error: %s (failed to read body: %v)", resp.Status, readErr) + } return fmt.Errorf("mount service error: %s (%s)", resp.Status, string(data)) } -- cgit v1.2.3