Skip to content

Commit 3b30875

Browse files
author
James DeFelice
committed
spec: Align volume validation with creation.
THIS IS A BREAKING CHANGE. * ValidateVolumeCapabilitiesRequest accepts the same parameters and topology requirements as CreateVolumeRequest. * ValidateVolumeCapabilitiesResponse is forward-compatible between newer COs (clients) and older plugins (servers). * fixes #242
1 parent f624381 commit 3b30875

File tree

3 files changed

+429
-324
lines changed

3 files changed

+429
-324
lines changed

csi.proto

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -631,28 +631,44 @@ message ValidateVolumeCapabilitiesRequest {
631631
// The ID of the volume to check. This field is REQUIRED.
632632
string volume_id = 1;
633633

634+
// Attributes of the volume to check. This field is OPTIONAL and MUST
635+
// match the attributes of the Volume identified by `volume_id`.
636+
map<string, string> volume_attributes = 2;
637+
634638
// The capabilities that the CO wants to check for the volume. This
635639
// call SHALL return "supported" only if all the volume capabilities
636640
// specified below are supported. This field is REQUIRED.
637-
repeated VolumeCapability volume_capabilities = 2;
641+
repeated VolumeCapability volume_capabilities = 3;
638642

639-
// Attributes of the volume to check. This field is OPTIONAL and MUST
640-
// match the attributes of the Volume identified by `volume_id`.
641-
map<string, string> volume_attributes = 3;
643+
// See CreateVolumeRequest.parameters.
644+
// This field is OPTIONAL.
645+
map<string, string> parameters = 4;
642646

643-
// Specifies where (regions, zones, racks, etc.) the caller believes
644-
// the volume is accessible from.
645-
// A caller MAY specify multiple topologies to indicate they believe
646-
// the volume to be accessible from multiple locations.
647-
// This field is OPTIONAL. This field SHALL NOT be set unless the
648-
// plugin advertises the ACCESSIBILITY_CONSTRAINTS capability.
649-
repeated Topology accessible_topology = 4;
647+
// See CreateVolumeRequest.accessibility_requirements.
648+
// This field is OPTIONAL.
649+
TopologyRequirement accessibility_requirements = 5;
650650
}
651651

652652
message ValidateVolumeCapabilitiesResponse {
653-
// True if the Plugin supports the specified capabilities for the
654-
// given volume. This field is REQUIRED.
655-
bool supported = 1;
653+
message Confirmed {
654+
// Volume capabilities supported by the plugin.
655+
// This field is REQUIRED.
656+
repeated VolumeCapability volume_capabilities = 1;
657+
658+
// Topology requirements supported by the plugin.
659+
// This field is OPTIONAL.
660+
TopologyRequirement accessibility_requirements = 2;
661+
}
662+
663+
// Confirmed indicates to the CO the set of capabilities that the
664+
// plugin has validated. This field SHALL only be set to a non-empty
665+
// value for successful validation responses.
666+
// For successful validation responses, the CO SHALL compare the
667+
// fields of this message to the originally requested capabilities in
668+
// order to guard against an older plugin reporting "valid" for newer
669+
// capability fields that it does not yet understand.
670+
// This field is OPTIONAL.
671+
Confirmed confirmed = 1;
656672

657673
// Message to the CO if `supported` above is false. This field is
658674
// OPTIONAL.

0 commit comments

Comments
 (0)