aboutsummaryrefslogtreecommitdiff
path: root/pkg
AgeCommit message (Collapse)AuthorFilesLines
14 daysfix: log process.stop() error and document 100ms delaychrislusf1-1/+4
- Log warning if stopping mount process fails after mount wait timeout to help diagnose potential zombie processes - Add comment explaining the 100ms delay before unmounting is for FUSE cleanup and pending I/O to complete
14 daysfix: use :latest tag and replace deprecated IsMountPointchrislusf1-6/+7
- 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
14 daysfix: remove redundant unmount call in Unmount functionchrislusf1-6/+3
The weedMountProcess.wait() function already handles unmounting when the process terminates. Removing the explicit unmount call in Unmount() centralizes the unmount logic and avoids potential race conditions.
14 daysfix: improve Unmount transactionality and add contextual loggingchrislusf1-6/+35
- Unmount now uses getMount first, only removes from state after all cleanup operations succeed (transactional behavior) - Add volume ID prefix to weed mount stdout/stderr logs for better debugging when multiple mounts are active
14 daysfix: address gemini review - permissions and process stopchrislusf1-4/+4
- Change cacheDir permissions from 0750 to 0755 for non-root access - Change targetPath (mount point) permissions from 0750 to 0755 - Remove ineffective os.ErrProcessDone checks (not exported in os package)
14 daysfix: address gemini review - OnDelete strategy and log invalid endpointchrislusf1-1/+3
- Change seaweedfs-mount DaemonSet updateStrategy from RollingUpdate to OnDelete in seaweedfs-csi.yaml for consistency with values.yaml (safer for active mounts) - Add warning log when invalid mountEndpoint is provided to aid debugging
14 daysfix: address gemini-code-assist review commentschrislusf1-2/+5
- 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
14 daysfix: address PR review commentschrislusf2-10/+11
- Set localSocket in rebuildVolumeFromStaging to fix invalid gRPC target - Use SHA256 hash (16 hex chars) in LocalSocketPath to minimize collision risk - Update GitHub Actions to latest versions (checkout@v4, metadata-action@v5, etc.) - Fix volumeMounts/volumes conditional mismatch in helm templates - Add documentation for mountService defaults in values.yaml
14 daysfix: improve ensureTargetClean to be non-recursive and always ensure ↵chrislusf1-10/+12
directory exists Address review feedback from gemini-code-assist: - Replace recursive approach with non-recursive to avoid potential stack overflow - Always call os.MkdirAll at the end to ensure directory exists after unmount - Add better error messages with context - Add logging for unmount operations
14 daysfix: address code review feedbackchrislusf6-16/+40
- 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)
14 daysfix: use kubeMounter instead of mountutil in manager.gochrislusf1-2/+2
14 daysfeat: add log泽淼 周1-15/+4
14 daysfix: Zombie process泽淼 周1-4/+6
14 daysOptimization: Reduce unnecessary logic of seaweedfs-mount泽淼 周6-250/+168
14 daysfeat: Separated weed mount lifecycle into a dedicated service and rewired ↵泽淼 周11-318/+776
the CSI components to call it.
2025-12-03fix: use RemoveAll for more robust staging path cleanupv1.3.5chrislusf1-1/+2
Address gemini-code-assist review - use os.RemoveAll instead of os.Remove to handle cases where the directory is not empty after an imperfect unmount. This ensures complete cleanup of stale staging paths.
2025-12-03fix: cleanup volume mutex on self-healing failure in NodePublishVolumechrislusf1-0/+2
Address gemini-code-assist review - when cleanup or re-staging fails during self-healing in NodePublishVolume, remove the volume mutex to avoid leaving stale entries. This maintains consistency with NodeStageVolume's error handling behavior.
2025-12-03fix: cleanup staged mount on quota application failurechrislusf1-0/+4
Address CodeRabbit review - if volume.Stage() succeeds but volume.Quota() fails, clean up the staged mount before returning the error to avoid leaving an orphaned FUSE process.
2025-12-03fix: propagate errors instead of just logging warningschrislusf2-3/+6
Address gemini-code-assist review feedback: 1. Return error from volume.Quota() failure in stageNewVolume - quota failures should fail the staging operation 2. Return error from cleanupStaleStagingPath() in NodeStageVolume - fail fast if cleanup fails rather than attempting to stage anyway 3. Return error from cleanupStaleStagingPath() in NodePublishVolume - same fail-fast behavior for consistency 4. Return error from mount.CleanupMountPoint() in Volume.Unstage() - propagate cleanup errors to caller as expected
2025-12-03fix: preserve healthy mounts in NodeStageVolume instead of re-stagingchrislusf1-13/+13
Address CodeRabbit review - when a healthy staging path exists after driver restart, rebuild the cache using rebuildVolumeFromStaging() instead of cleaning up and re-staging. This: - Maintains consistency with NodePublishVolume behavior - Avoids disrupting existing published volumes that are bind-mounted - Makes NodeStageVolume idempotent as per CSI spec
2025-12-03fix: add nil checks for AccessMode to prevent panicchrislusf1-2/+10
Address CodeRabbit review feedback - add defensive nil checks for GetVolumeCapability() and GetAccessMode() in both isPublishVolumeReadOnly and isVolumeReadOnly to prevent potential nil pointer dereference.
2025-12-03refactor: address code review feedbackchrislusf3-59/+43
- Handle unexpected stat errors in cleanupStaleStagingPath (high priority) - Extract staging logic into stageNewVolume helper method for reuse - Extract isReadOnlyAccessMode helper to avoid duplicated read-only checks - Remove redundant mountutil.Unmount call (CleanupMountPoint already handles it)
2025-12-03fix: add self-healing for volume mount failures after driver restartchrislusf3-7/+205
This addresses issue #203 - CSI Driver Self-Healing for Volume Mount Failures. Problem: When the CSI node driver restarts, the in-memory volume cache is lost. Kubelet then directly calls NodePublishVolume (skipping NodeStageVolume), which fails with 'volume hasn't been staged yet' error. Solution: 1. Added isStagingPathHealthy() to detect healthy vs stale/corrupted mounts 2. Added cleanupStaleStagingPath() to clean up stale mount points 3. Enhanced NodeStageVolume to clean up stale mounts before staging 4. Implemented self-healing in NodePublishVolume: - If staging path is healthy: rebuild volume cache from existing mount - If staging path is stale: clean up and re-stage automatically 5. Updated Volume.Unstage to handle rebuilt volumes without unmounter Benefits: - Automatic recovery after CSI driver restarts - No manual intervention required (no kubelet/pod restarts needed) - Handles both live and dead FUSE mount scenarios - Backward compatible with normal operations Fixes #203
2025-10-23fix error messagev1.3.2chrislusf1-2/+2
2025-10-23Fix filer_pb API signatures to include context parameterchrislusf1-3/+3
The filer_pb.Mkdir, filer_pb.Remove, and filer_pb.Exists functions now require context.Context as the first parameter. This commit updates all three function calls in controllerserver.go to match the updated API. Fixes #206
2025-05-04Use only lowercase letters in the volume ID to avoid case matching issuesAaron Madsen1-0/+2
2025-05-04Make sure the volume ID is a valid bucket nameAaron Madsen1-5/+30
2024-07-21fix buildv1.2.1chrislu1-0/+1
2024-06-20deal with config errorchrislu1-3/+4
fix https://github.com/seaweedfs/seaweedfs-csi-driver/issues/169
2024-06-06fix(driver): nomad compatibility errorduanhongyi1-1/+1
2024-03-29Use capacity of one byte as 'no quota'Viktor Kuzmin2-1/+9
2024-01-18Revert "chore(seaweedfs-csi-driver): delete unnecessary stage"chrislu3-45/+166
This reverts commit 44283c0ffe56e3180dae5b93801d07a3d621d355.
2024-01-18Revert "Fix: unable to properly clean mount points"chrislu2-75/+66
This reverts commit 4f60c279001475dcb398ed8c852ff2c6e366e16e.
2024-01-15Fix: unable to properly clean mount pointsduanhongyi2-66/+75
2024-01-11chore(seaweedfs-csi-driver): delete unnecessary stageduanhongyi3-166/+45
2024-01-11Fix: capacity error in re mounting after expand volumeduanhongyi5-28/+53
2023-11-05Merge branch 'master' of https://github.com/seaweedfs/seaweedfs-csi-driverchrislu8-30/+12
2023-10-19Feat: add driver name supportduanhongyi1-7/+3
2023-09-25Revert "Revert "Merge branch 'master' of ↵chrislu1-1/+1
https://github.com/seaweedfs/seaweedfs"" This reverts commit 8cb42c39
2023-08-10Fix: the channel used with signal.Notify should be buffered (SA1017)n91-1/+1
2023-08-10Removed unused fieldn91-2/+1
2023-08-10Fix: error strings should not be capitalized (ST1005)n94-6/+6
Context: https://github.com/golang/go/wiki/CodeReviewComments#error-strings https://stackoverflow.com/a/68793833
2023-08-10Clean uselessn91-2/+0
2023-08-10Added missing argn91-1/+1
2023-08-10Removed unused methodn91-11/+0
2023-08-07Allow to separate ControllerServer and NodeServer, allow to disable attacher ↵Viktor Kuzmin1-7/+24
(it do nothing in reality)
2023-08-07gofmt of mounter_seaweedfsViktor Kuzmin1-32/+34
2023-08-07Log cache clear errorsViktor Kuzmin1-1/+4
2023-08-07Implement ExpandVolume also for controllerViktor Kuzmin2-0/+13
https://kubernetes-csi.github.io/docs/volume-expansion.html CSI Resizer should be always run even if not implemented. Also it should run only against controller. Volume resize on node rpc call is handled by kubelet. For now the only job for controller's volume resize is to make it two step and propagate changes to node.
2023-08-07Fix Add...Capability functions - capabilities now added instead of replacedViktor Kuzmin1-12/+3