Commit 44f583e
committed
fix: propagate read-only mount from staging path and volume capability in NodePublishVolume
Previously, NodePublishVolume only checked req.GetReadonly() to decide
whether to add 'ro' to the bind mount options. This meant that when a
PV had csi.readOnly: true or mountOptions including 'ro', but the pod
spec volumeMounts did not explicitly set readOnly: true, the bind mount
would be writable.
Fix by also checking:
1. Volume capability access mode (MULTI_NODE_READER_ONLY,
SINGLE_NODE_READER_ONLY)
2. Whether the staging mount path has 'ro' in its mount options
This ensures read-only intent from PV-level settings is properly
propagated to the final bind mount.
Ref 9871 parent fef7ae9 commit 44f583e
1 file changed
+25
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
83 | 107 | | |
84 | 108 | | |
85 | 109 | | |
| |||
0 commit comments