Skip to content

Commit 7da5269

Browse files
authored
Merge pull request #318 from saad-ali/renameVolumeAttributes
Rename volume `attributes`, `publish_info`, and `id`
2 parents b819389 + fe410c4 commit 7da5269

File tree

3 files changed

+545
-450
lines changed

3 files changed

+545
-450
lines changed

csi.proto

Lines changed: 82 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,14 @@ message VolumeContentSource {
251251
// This field is REQUIRED. Plugin is REQUIRED to support creating
252252
// volume from snapshot if it supports the capability
253253
// CREATE_DELETE_SNAPSHOT.
254-
string id = 1;
254+
string snapshot_id = 1;
255255
}
256256

257257
message VolumeSource {
258258
// Contains identity information for the existing source volume.
259259
// This field is REQUIRED. Plugins reporting CLONE_VOLUME
260260
// capability MUST support creating a volume from another volume.
261-
string id = 1;
261+
string volume_id = 1;
262262
}
263263

264264
oneof type {
@@ -350,28 +350,40 @@ message CapacityRange {
350350
int64 limit_bytes = 2;
351351
}
352352

353-
// The information about a provisioned volume.
353+
// Information about a specific volume.
354354
message Volume {
355355
// The capacity of the volume in bytes. This field is OPTIONAL. If not
356356
// set (value of 0), it indicates that the capacity of the volume is
357357
// unknown (e.g., NFS share).
358358
// The value of this field MUST NOT be negative.
359359
int64 capacity_bytes = 1;
360360

361-
// Contains identity information for the created volume. This field is
362-
// REQUIRED. The identity information will be used by the CO in
363-
// subsequent calls to refer to the provisioned volume.
364-
string id = 2;
365-
366-
// Attributes reflect static properties of a volume and MUST be passed
367-
// to volume validation and publishing calls.
368-
// Attributes SHALL be opaque to a CO. Attributes SHALL NOT be mutable
369-
// and SHALL be safe for the CO to cache. Attributes SHOULD NOT
370-
// contain sensitive information. Attributes MAY NOT uniquely identify
371-
// a volume. A volume uniquely identified by `id` SHALL always report
372-
// the same attributes. This field is OPTIONAL and when present MUST
373-
// be passed to volume validation and publishing calls.
374-
map<string, string> attributes = 3;
361+
// The identifier for this volume, generated by the plugin.
362+
// This field is REQUIRED.
363+
// This field MUST contain enough information to uniquely identify
364+
// this specific volume vs all other volumes supported by this plugin.
365+
// This field SHALL be used by the CO in subsequent calls to refer to
366+
// this volume.
367+
// The SP is NOT responsible for global uniqueness of volume_id across
368+
// multiple SPs.
369+
string volume_id = 2;
370+
371+
// Opaque static properties of the volume. SP MAY use this field to
372+
// ensure subsequent volume validation and publishing calls have
373+
// contextual information.
374+
// The contents of this field SHALL be opaque to a CO.
375+
// The contents of this field SHALL NOT be mutable.
376+
// The contents of this field SHALL be safe for the CO to cache.
377+
// The contents of this field SHOULD NOT contain sensitive
378+
// information.
379+
// The contents of this field SHOULD NOT be used for uniquely
380+
// identifying a volume. The `volume_id` alone should be sufficient to
381+
// identify the volume.
382+
// A volume uniquely identified by `volume_id` SHALL always report the
383+
// same volume_context.
384+
// This field is OPTIONAL and when present MUST be passed to volume
385+
// validation and publishing calls.
386+
map<string, string> volume_context = 3;
375387

376388
// If specified, indicates that the volume is not empty and is
377389
// pre-populated with data from the specified source.
@@ -609,18 +621,27 @@ message ControllerPublishVolumeRequest {
609621
// `Secrets Requirements` section on how to use this field.
610622
map<string, string> secrets = 5 [(csi_secret) = true];
611623

612-
// Attributes of the volume to be used on a node. This field is
613-
// OPTIONAL and MUST match the attributes of the Volume identified
614-
// by `volume_id`.
615-
map<string, string> volume_attributes = 6;
624+
// Volume context as returned by CO in CreateVolumeRequest. This field
625+
// is OPTIONAL and MUST match the volume_context of the volume
626+
// identified by `volume_id`.
627+
map<string, string> volume_context = 6;
616628
}
617629

618630
message ControllerPublishVolumeResponse {
619-
// The SP specific information that will be passed to the Plugin in
620-
// the subsequent `NodeStageVolume` or `NodePublishVolume` calls
621-
// for the given volume.
622-
// This information is opaque to the CO. This field is OPTIONAL.
623-
map<string, string> publish_info = 1;
631+
// Opaque static publish properties of the volume. SP MAY use this
632+
// field to ensure subsequent `NodeStageVolume` or `NodePublishVolume`
633+
// calls calls have contextual information.
634+
// The contents of this field SHALL be opaque to a CO.
635+
// The contents of this field SHALL NOT be mutable.
636+
// The contents of this field SHALL be safe for the CO to cache.
637+
// The contents of this field SHOULD NOT contain sensitive
638+
// information.
639+
// The contents of this field SHOULD NOT be used for uniquely
640+
// identifying a volume. The `id` alone should be sufficient to
641+
// identify the volume.
642+
// This field is OPTIONAL and when present MUST be passed to
643+
// subsequent `NodeStageVolume` or `NodePublishVolume` calls
644+
map<string, string> publish_context = 1;
624645
}
625646
message ControllerUnpublishVolumeRequest {
626647
// The ID of the volume. This field is REQUIRED.
@@ -648,9 +669,10 @@ message ValidateVolumeCapabilitiesRequest {
648669
// The ID of the volume to check. This field is REQUIRED.
649670
string volume_id = 1;
650671

651-
// Attributes of the volume to check. This field is OPTIONAL and MUST
652-
// match the attributes of the Volume identified by `volume_id`.
653-
map<string, string> volume_attributes = 2;
672+
// Volume context as returned by CO in CreateVolumeRequest. This field
673+
// is OPTIONAL and MUST match the volume_context of the volume
674+
// identified by `volume_id`.
675+
map<string, string> volume_context = 2;
654676

655677
// The capabilities that the CO wants to check for the volume. This
656678
// call SHALL return "confirmed" only if all the volume capabilities
@@ -669,9 +691,9 @@ message ValidateVolumeCapabilitiesRequest {
669691

670692
message ValidateVolumeCapabilitiesResponse {
671693
message Confirmed {
672-
// Volume attributes validated by the plugin.
694+
// Volume context validated by the plugin.
673695
// This field is OPTIONAL.
674-
map<string, string> volume_attributes = 1;
696+
map<string, string> volume_context = 1;
675697

676698
// Volume capabilities supported by the plugin.
677699
// This field is REQUIRED.
@@ -843,7 +865,7 @@ message CreateSnapshotResponse {
843865
Snapshot snapshot = 1;
844866
}
845867

846-
// The information about a provisioned snapshot.
868+
// Information about a specific snapshot.
847869
message Snapshot {
848870
// This is the complete size of the snapshot in bytes. The purpose of
849871
// this field is to give CO guidance on how much space is needed to
@@ -854,11 +876,16 @@ message Snapshot {
854876
// zero means it is unspecified.
855877
int64 size_bytes = 1;
856878

857-
// Uniquely identifies a snapshot and is generated by the plugin. It
858-
// will not change over time. This field is REQUIRED. The identity
859-
// information will be used by the CO in subsequent calls to refer to
860-
// the provisioned snapshot.
861-
string id = 2;
879+
// The identifier for this snapshot, generated by the plugin.
880+
// This field is REQUIRED.
881+
// This field MUST contain enough information to uniquely identify
882+
// this specific snapshot vs all other snapshots supported by this
883+
// plugin.
884+
// This field SHALL be used by the CO in subsequent calls to refer to
885+
// this snapshot.
886+
// The SP is NOT responsible for global uniqueness of snapshot_id
887+
// across multiple SPs.
888+
string snapshot_id = 2;
862889

863890
// Identity information for the source volume. Note that creating a
864891
// snapshot from a snapshot is not supported here so the source has to
@@ -944,7 +971,7 @@ message NodeStageVolumeRequest {
944971
// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
945972
// left unset if the corresponding Controller Plugin does not have
946973
// this capability. This is an OPTIONAL field.
947-
map<string, string> publish_info = 2;
974+
map<string, string> publish_context = 2;
948975

949976
// The path to which the volume MAY be staged. It MUST be an
950977
// absolute path in the root filesystem of the process serving this
@@ -967,10 +994,10 @@ message NodeStageVolumeRequest {
967994
// section on how to use this field.
968995
map<string, string> secrets = 5 [(csi_secret) = true];
969996

970-
// Attributes of the volume to stage. This field is OPTIONAL and
971-
// MUST match the attributes of the `Volume` identified by
972-
// `volume_id`.
973-
map<string, string> volume_attributes = 6;
997+
// Volume context as returned by CO in CreateVolumeRequest. This field
998+
// is OPTIONAL and MUST match the volume_context of the volume
999+
// identified by `volume_id`.
1000+
map<string, string> volume_context = 6;
9741001
}
9751002

9761003
message NodeStageVolumeResponse {
@@ -998,7 +1025,7 @@ message NodePublishVolumeRequest {
9981025
// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
9991026
// left unset if the corresponding Controller Plugin does not have
10001027
// this capability. This is an OPTIONAL field.
1001-
map<string, string> publish_info = 2;
1028+
map<string, string> publish_context = 2;
10021029

10031030
// The path to which the volume was staged by `NodeStageVolume`.
10041031
// It MUST be an absolute path in the root filesystem of the process
@@ -1032,10 +1059,10 @@ message NodePublishVolumeRequest {
10321059
// section on how to use this field.
10331060
map<string, string> secrets = 7 [(csi_secret) = true];
10341061

1035-
// Attributes of the volume to publish. This field is OPTIONAL and
1036-
// MUST match the attributes of the Volume identified by
1037-
// `volume_id`.
1038-
map<string, string> volume_attributes = 8;
1062+
// Volume context as returned by CO in CreateVolumeRequest. This field
1063+
// is OPTIONAL and MUST match the volume_context of the volume
1064+
// identified by `volume_id`.
1065+
map<string, string> volume_context = 8;
10391066
}
10401067

10411068
message NodePublishVolumeResponse {
@@ -1126,9 +1153,14 @@ message NodeGetInfoRequest {
11261153
}
11271154

11281155
message NodeGetInfoResponse {
1129-
// The ID of the node as understood by the SP which SHALL be used by
1130-
// CO in subsequent calls to `ControllerPublishVolume`.
1131-
// This is a REQUIRED field.
1156+
// The identifier of the node as understood by the SP.
1157+
// This field is REQUIRED.
1158+
// This field MUST contain enough information to uniquely identify
1159+
// this specific node vs all other nodes supported by this plugin.
1160+
// This field SHALL be used by the CO in subsequent calls, including
1161+
// `ControllerPublishVolume`, to refer to this node.
1162+
// The SP is NOT responsible for global uniqueness of node_id across
1163+
// multiple SPs.
11321164
string node_id = 1;
11331165

11341166
// Maximum number of volumes that controller can publish to the node.

0 commit comments

Comments
 (0)