Skip to content

Commit

Permalink
feat: support ReadWriteOncePod (#857)
Browse files Browse the repository at this point in the history
According to
[KEP-2485](https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode/README.md#csi-specification-changes-volume-capabilities),
if the csi-driver exposes the `SINGLE_NODE_MULTI_WRITER` capability,
then `ReadWriteOncePod` will map to the `SINGLE_NODE_SINGLE_WRITER`
volume capability, otherwise it will map to `SINGLE_NODE_WRITER`. Our
controller already responded with the `SINGLE_NODE_MULTI_WRITER`, but we
blocked `SINGLE_NODE_SINGLE_WRITER` in a validation step in the
`ControllerPublishVolume` method.

Additional reference:
-
https://kubernetes.io/blog/2021/09/13/read-write-once-pod-access-mode-alpha/#accept-new-csi-access-modes
- #327
  • Loading branch information
lukasmetzner authored Jan 20, 2025
1 parent 0b926cc commit ec38e2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/driver/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func isCapabilitySupported(capability *proto.VolumeCapability) bool {
return true
case proto.VolumeCapability_AccessMode_SINGLE_NODE_MULTI_WRITER:
return true
case proto.VolumeCapability_AccessMode_SINGLE_NODE_SINGLE_WRITER:
return true
default:
return false
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/kubernetes/testdriver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DriverInfo:
topology: true
capacity: false
FSResizeFromSourceNotSupported: false
readWriteOncePod: false # https://github.com/hetznercloud/csi-driver/issues/327
readWriteOncePod: true # https://github.com/hetznercloud/csi-driver/issues/327
multiplePVsSameID: true # No need to disable according to comment on CapMultiplePVsSameID
capReadOnlyMany: false
SupportedFsType:
Expand Down

0 comments on commit ec38e2b

Please sign in to comment.