Skip to content

Commit 14ea8bc

Browse files
committed
return errors for multiple node-publish
Also expand about lifecycle of readable/writable permisssions
1 parent 3698151 commit 14ea8bc

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

csi.proto

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ message NodePublishVolumeRequest {
13131313
// within the volume are readable and writable by the provided
13141314
// volume_mount_group.
13151315
// If NodeStageVolume was previously called with volume_mount_group
1316-
// CO must ensure that NodePublishVolume uses the same
1316+
// CO MUST ensure that NodePublishVolume uses the same
13171317
// volume_mount_group for the same volume_id.
13181318
// The value of volume_mount_group should be group_id or group name
13191319
// which would be associated with workload that uses the
@@ -1438,8 +1438,13 @@ message NodeServiceCapability {
14381438
// informative for humans only, not for automation.
14391439
VOLUME_CONDITION = 4 [(alpha_enum_value) = true];
14401440
// Indicates that Node service supports mounting volumes
1441-
// with provider volume group identifier during node stage
1441+
// with provided volume group identifier during node stage
14421442
// or node publish RPC calls.
1443+
// It is expected that SP SHOULD use provided volume_mount_group
1444+
// for mounting the volume and volume should remain readable and
1445+
// writable by workloads associated with volume_mount_group until
1446+
// corresponding NodeUnstageVolume or NodeUnpublishVolume is
1447+
// called.
14431448
VOLUME_MOUNT_GROUP = 5 [(alpha_enum_value) = true];
14441449
}
14451450

lib/go/csi/csi.pb.go

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,10 @@ The following table shows what the Plugin SHOULD return when receiving a second
21962196
| MULTI_NODE | OK (idempotent) | ALREADY_EXISTS | OK | OK |
21972197
| Non MULTI_NODE | OK (idempotent) | ALREADY_EXISTS | FAILED_PRECONDITION | FAILED_PRECONDITION|
21982198

2199-
(`Tn`: target path of the n-th `NodePublishVolume`, `Pn`: other arguments of the n-th `NodePublishVolume` except `secrets`)
2199+
(`Tn`: target path of the n-th `NodePublishVolume`, `Pn`: other arguments of the n-th `NodePublishVolume` except `secrets`).
2200+
2201+
However if a Plugin does not support `NodePublishVolume` of same volume on same node multiple times with different `volume_mount_group` on different `target_path` it MAY return `FAILED_PRECONDITION` error.
2202+
22002203

22012204
```protobuf
22022205
message NodePublishVolumeRequest {
@@ -2259,7 +2262,7 @@ message NodePublishVolumeRequest {
22592262
// within the volume are readable and writable by the provided
22602263
// volume_mount_group.
22612264
// If NodeStageVolume was previously called with volume_mount_group
2262-
// CO must ensure that NodePublishVolume uses the same
2265+
// CO MUST ensure that NodePublishVolume uses the same
22632266
// volume_mount_group for the same volume_id.
22642267
// The value of volume_mount_group should be group_id or group name
22652268
// which would be associated with workload that uses the
@@ -2286,6 +2289,7 @@ The CO MUST implement the specified error recovery behavior when it encounters t
22862289
| Exceeds capabilities | 9 FAILED_PRECONDITION | Indicates that the CO has exceeded the volume's capabilities because the volume does not have MULTI_NODE capability. | Caller MAY choose to call `ValidateVolumeCapabilities` to validate the volume capabilities, or wait for the volume to be unpublished on the node. |
22872290
| Staging target path not set | 9 FAILED_PRECONDITION | Indicates that `STAGE_UNSTAGE_VOLUME` capability is set but no `staging_target_path` was set. | Caller MUST make sure call to `NodeStageVolume` is made and returns success before retrying with valid `staging_target_path`. |
22882291
| Volume staged with different volume_mount_group | 9 FAILED_PRECONDITION | Indicates that volume with specified `volume_id` was node staged using different `volume_mount_group` on this node and hence can not be node published. | Caller MUST make sure that `NodePublishVolume` is called with same `volume_mount_group` which was used in `NodeStageVolume`. |
2292+
| Volume already published with different volume_mount_group | 9 FAILED_PRECONDITION | Indicates that the volume with specified `volume_id` was already node published using different `volume_mount_group` on this node and can not be node published. | Caller MUST ensure that `NodePublishVolume` is called with same `volume_mount_group` on all target paths. |
22892293

22902294

22912295
#### `NodeUnpublishVolume`
@@ -2461,8 +2465,13 @@ message NodeServiceCapability {
24612465
// informative for humans only, not for automation.
24622466
VOLUME_CONDITION = 4 [(alpha_enum_value) = true];
24632467
// Indicates that Node service supports mounting volumes
2464-
// with provider volume group identifier during node stage
2468+
// with provided volume group identifier during node stage
24652469
// or node publish RPC calls.
2470+
// It is expected that SP SHOULD use provided volume_mount_group
2471+
// for mounting the volume and volume should remain readable and
2472+
// writable by workloads associated with volume_mount_group until
2473+
// corresponding NodeUnstageVolume or NodeUnpublishVolume is
2474+
// called.
24662475
VOLUME_MOUNT_GROUP = 5 [(alpha_enum_value) = true];
24672476
}
24682477

0 commit comments

Comments
 (0)