Ticket 109 - Add allowMultipleSessions StorageClass Parameter for iSCSI Volumes#127
Ticket 109 - Add allowMultipleSessions StorageClass Parameter for iSCSI Volumes#127smurfless1 wants to merge 2 commits into
Conversation
Adds a new StorageClass parameter 'allowMultipleSessions' that enables multiple iSCSI sessions to a target, allowing PVCs to remount after node or pod restarts without requiring ReadWriteMany access mode. This resolves issues where ReadWriteOnce PVCs fail to remount after node restarts because Synology DSM blocks multiple sessions by default. Changes: - Add allowMultipleSessions parameter parsing in controllerserver.go - Enable multi-session when parameter is true, regardless of access mode - Add comprehensive unit tests for parameter behavior - Update README.md with parameter documentation - Update sanity tests to use iSCSI with allowMultipleSessions Bug fixes: - Fix format string mismatch in multipath.go (use %d for integer) - Fix missing dsmIp argument in nodeserver.go log statement - Fix unkeyed struct literals in iscsi.go and share.go Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
| @@ -0,0 +1,324 @@ | |||
| /* | |||
| Copyright 2021 Synology Inc. | |||
There was a problem hiding this comment.
What's a few years between friends?
| if ee, ok := err.(utilexec.ExitError); ok { | ||
| log.Errorf("Non-zero exit code: %s", err) | ||
| err = fmt.Errorf("%s", ee.ExitStatus()) | ||
| err = fmt.Errorf("%d", ee.ExitStatus()) |
There was a problem hiding this comment.
These other fixes were simply because my linter would not let it go.
| log.Infof("Volume [%s]: allowMultipleSessions parameter ignored for protocol [%s]", volName, protocol) | ||
| } else if allowMultipleSessions && !multiSession { | ||
| log.Infof("Enabling multi-session for volume [%s] via allowMultipleSessions parameter", volName) | ||
| multiSession = true |
There was a problem hiding this comment.
This was mentioned in the discussion of ticket 109. I simply had Claude help me through implementing it in a clear way.
I'm actually running this version on my NAS and have had k3s and microk8s quite happy with it for a week and change, so I'm happy so far.
| } | ||
| } | ||
|
|
||
| func TestCreateVolume_AllowMultipleSessions(t *testing.T) { |
There was a problem hiding this comment.
I was particularly stern with Claude that we must have tests for the new functionality. They mostly center on configuration, but as really the change is mostly about configuration, I shouldn't be surprised.
|
Issue link with really good root cause discussion: |
Summary
Changes
New Feature:
Bug Fixes:
Code Quality:
Test Updates: