Skip to content

Commit 5fc87ca

Browse files
akutzdavidz627
authored andcommitted
NodePublishDevice
This patch handles issue container-storage-interface#119 by adding two new RPCs, "NodePublishDevice" and "NodeUnpublishDevice". These RPCs MUST be called by the CO if the Node Plugin advertises the "PUBLISH_UNPUBLISH_DEVICE" capability. Plugins that advertise this capability SHOULD defer volume reference counting to the CO.
1 parent e9e5320 commit 5fc87ca

File tree

3 files changed

+801
-777
lines changed

3 files changed

+801
-777
lines changed

csi.proto

Lines changed: 93 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ service Controller {
4444
}
4545

4646
service Node {
47+
rpc NodePublishDevice (NodePublishDeviceRequest)
48+
returns (NodePublishDeviceResponse) {}
49+
50+
rpc NodeUnpublishDevice (NodeUnpublishDeviceRequest)
51+
returns (NodeUnpublishDeviceResponse) {}
52+
4753
rpc NodePublishVolume (NodePublishVolumeRequest)
4854
returns (NodePublishVolumeResponse) {}
4955

@@ -182,18 +188,18 @@ message CreateVolumeRequest {
182188
// validating these parameters. COs will treat these as opaque.
183189
map<string, string> parameters = 5;
184190

185-
// Credentials used by Controller plugin to authenticate/authorize
186-
// volume creation request.
191+
// End user credentials used to authenticate/authorize volume creation
192+
// request.
187193
// This field contains credential data, for example username and
188194
// password. Each key must consist of alphanumeric characters, '-',
189195
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
190196
// choose to accept binary (non-string) data by using a binary-to-text
191197
// encoding scheme, like base64. An SP SHALL advertise the
192198
// requirements for credentials in documentation. COs SHALL permit
193-
// passing through the required credentials. This information is
199+
// users to pass through the required credentials. This information is
194200
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
195201
// This field is OPTIONAL.
196-
map<string, string> controller_create_credentials = 6;
202+
map<string, string> user_credentials = 6;
197203
}
198204

199205
message CreateVolumeResponse {
@@ -312,18 +318,18 @@ message DeleteVolumeRequest {
312318
// This field is REQUIRED.
313319
string volume_id = 2;
314320

315-
// Credentials used by Controller plugin to authenticate/authorize
316-
// volume deletion request.
321+
// End user credentials used to authenticate/authorize volume deletion
322+
// request.
317323
// This field contains credential data, for example username and
318324
// password. Each key must consist of alphanumeric characters, '-',
319325
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
320326
// choose to accept binary (non-string) data by using a binary-to-text
321327
// encoding scheme, like base64. An SP SHALL advertise the
322328
// requirements for credentials in documentation. COs SHALL permit
323-
// passing through the required credentials. This information is
329+
// users to pass through the required credentials. This information is
324330
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
325331
// This field is OPTIONAL.
326-
map<string, string> controller_delete_credentials = 3;
332+
map<string, string> user_credentials = 3;
327333
}
328334

329335
message DeleteVolumeResponse {}
@@ -349,18 +355,18 @@ message ControllerPublishVolumeRequest {
349355
// REQUIRED.
350356
bool readonly = 5;
351357

352-
// Credentials used by Controller plugin to authenticate/authorize
353-
// controller publish request.
358+
// End user credentials used to authenticate/authorize controller
359+
// publish request.
354360
// This field contains credential data, for example username and
355361
// password. Each key must consist of alphanumeric characters, '-',
356362
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
357363
// choose to accept binary (non-string) data by using a binary-to-text
358364
// encoding scheme, like base64. An SP SHALL advertise the
359365
// requirements for credentials in documentation. COs SHALL permit
360-
// passing through the required credentials. This information is
366+
// users to pass through the required credentials. This information is
361367
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
362368
// This field is OPTIONAL.
363-
map<string, string> controller_publish_credentials = 6;
369+
map<string, string> user_credentials = 6;
364370

365371
// Attributes of the volume to be used on a node. This field is
366372
// OPTIONAL and MUST match the attributes of the Volume identified
@@ -370,7 +376,8 @@ message ControllerPublishVolumeRequest {
370376

371377
message ControllerPublishVolumeResponse {
372378
// The SP specific information that will be passed to the Plugin in
373-
// the subsequent `NodePublishVolume` call for the given volume.
379+
// the subsequent `NodePublishDevice` and `NodePublishVolume` calls
380+
// for the given volume.
374381
// This information is opaque to the CO. This field is OPTIONAL.
375382
map<string, string> publish_info = 1;
376383
}
@@ -390,18 +397,18 @@ message ControllerUnpublishVolumeRequest {
390397
// the volume from all nodes it is published to.
391398
string node_id = 3;
392399

393-
// Credentials used by Controller plugin to authenticate/authorize
394-
// controller unpublish request.
400+
// End user credentials used to authenticate/authorize controller
401+
// unpublish request.
395402
// This field contains credential data, for example username and
396403
// password. Each key must consist of alphanumeric characters, '-',
397404
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
398405
// choose to accept binary (non-string) data by using a binary-to-text
399406
// encoding scheme, like base64. An SP SHALL advertise the
400407
// requirements for credentials in documentation. COs SHALL permit
401-
// passing through the required credentials. This information is
408+
// users to pass through the required credentials. This information is
402409
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
403410
// This field is OPTIONAL.
404-
map<string, string> controller_unpublish_credentials = 4;
411+
map<string, string> user_credentials = 4;
405412
}
406413

407414
message ControllerUnpublishVolumeResponse {}
@@ -543,6 +550,51 @@ message ControllerServiceCapability {
543550
}
544551
////////
545552
////////
553+
message NodePublishDeviceRequest {
554+
// The API version assumed by the CO. This is a REQUIRED field.
555+
Version version = 1;
556+
557+
// The ID of the volume to publish. This field is REQUIRED.
558+
string volume_id = 2;
559+
560+
// The CO SHALL set this field to the value returned by
561+
// `ControllerPublishVolume` if the corresponding Controller Plugin
562+
// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
563+
// left unset if the corresponding Controller Plugin does not have
564+
// this capability. This is an OPTIONAL field.
565+
map<string, string> publish_volume_info = 3;
566+
567+
// The path to which the volume will be published. It MUST be an
568+
// absolute path in the root filesystem of the process serving this
569+
// request. The CO SHALL ensure uniqueness of global_target_path per
570+
// volume.
571+
// This is a REQUIRED field.
572+
string global_target_path = 4;
573+
574+
// The capability of the volume the CO expects the volume to have.
575+
// This is a REQUIRED field.
576+
VolumeCapability volume_capability = 5;
577+
}
578+
579+
message NodePublishDeviceResponse {}
580+
////////
581+
////////
582+
message NodeUnpublishDeviceRequest {
583+
// The API version assumed by the CO. This is a REQUIRED field.
584+
Version version = 1;
585+
586+
// The ID of the volume. This field is REQUIRED.
587+
string volume_id = 2;
588+
589+
// The path at which the volume was published. It MUST be an absolute
590+
// path in the root filesystem of the process serving this request.
591+
// This is a REQUIRED field.
592+
string global_target_path = 3;
593+
}
594+
595+
message NodeUnpublishDeviceResponse {}
596+
////////
597+
////////
546598
message NodePublishVolumeRequest {
547599
// The API version assumed by the CO. This is a REQUIRED field.
548600
Version version = 1;
@@ -557,39 +609,45 @@ message NodePublishVolumeRequest {
557609
// this capability. This is an OPTIONAL field.
558610
map<string, string> publish_info = 3;
559611

612+
// The path to which the device was mounted by `NodePublishDevice`.
613+
// It MUST be an absolute path in the root filesystem of the process
614+
// serving this request.
615+
// This is an OPTIONAL field.
616+
string global_target_path = 4;
617+
560618
// The path to which the volume will be published. It MUST be an
561619
// absolute path in the root filesystem of the process serving this
562620
// request. The CO SHALL ensure uniqueness of target_path per volume.
563621
// The CO SHALL ensure that the path exists, and that the process
564622
// serving the request has `read` and `write` permissions to the path.
565623
// This is a REQUIRED field.
566-
string target_path = 4;
624+
string target_path = 5;
567625

568626
// The capability of the volume the CO expects the volume to have.
569627
// This is a REQUIRED field.
570-
VolumeCapability volume_capability = 5;
628+
VolumeCapability volume_capability = 6;
571629

572630
// Whether to publish the volume in readonly mode. This field is
573631
// REQUIRED.
574-
bool readonly = 6;
632+
bool readonly = 7;
575633

576-
// Credentials used by Node plugin to authenticate/authorize node
634+
// End user credentials used to authenticate/authorize node
577635
// publish request.
578636
// This field contains credential data, for example username and
579637
// password. Each key must consist of alphanumeric characters, '-',
580638
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
581639
// choose to accept binary (non-string) data by using a binary-to-text
582640
// encoding scheme, like base64. An SP SHALL advertise the
583641
// requirements for credentials in documentation. COs SHALL permit
584-
// passing through the required credentials. This information is
642+
// users to pass through the required credentials. This information is
585643
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
586644
// This field is OPTIONAL.
587-
map<string, string> node_publish_credentials = 7;
645+
map<string, string> user_credentials = 8;
588646

589647
// Attributes of the volume to publish. This field is OPTIONAL and
590648
// MUST match the attributes of the Volume identified by
591649
// `volume_id`.
592-
map<string,string> volume_attributes = 8;
650+
map<string,string> volume_attributes = 9;
593651
}
594652

595653
message NodePublishVolumeResponse {}
@@ -602,23 +660,29 @@ message NodeUnpublishVolumeRequest {
602660
// The ID of the volume. This field is REQUIRED.
603661
string volume_id = 2;
604662

663+
// The path to which the device was mounted by `NodePublishDevice`.
664+
// It MUST be an absolute path in the root filesystem of the process
665+
// serving this request.
666+
// This is an OPTIONAL field.
667+
string global_target_path = 3;
668+
605669
// The path at which the volume was published. It MUST be an absolute
606670
// path in the root filesystem of the process serving this request.
607671
// This is a REQUIRED field.
608-
string target_path = 3;
672+
string target_path = 4;
609673

610-
// Credentials used by Node plugin to authenticate/authorize node
674+
// End user credentials used to authenticate/authorize node
611675
// unpublish request.
612676
// This field contains credential data, for example username and
613677
// password. Each key must consist of alphanumeric characters, '-',
614678
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
615679
// choose to accept binary (non-string) data by using a binary-to-text
616680
// encoding scheme, like base64. An SP SHALL advertise the
617681
// requirements for credentials in documentation. COs SHALL permit
618-
// passing through the required credentials. This information is
682+
// users to pass through the required credentials. This information is
619683
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
620684
// This field is OPTIONAL.
621-
map<string, string> node_unpublish_credentials = 4;
685+
map<string, string> user_credentials = 5;
622686
}
623687

624688
message NodeUnpublishVolumeResponse {}
@@ -661,6 +725,7 @@ message NodeServiceCapability {
661725
message RPC {
662726
enum Type {
663727
UNKNOWN = 0;
728+
PUBLISH_UNPUBLISH_DEVICE = 1;
664729
}
665730

666731
Type type = 1;

0 commit comments

Comments
 (0)