Skip to content

Commit

Permalink
GetCapacityResponse: minimum volume size
Browse files Browse the repository at this point in the history
Using CapacityRange in GetCapacityResponse is not a good fit because
the names of its fields is a bit awkward. By adding two fields in
GetCapacityResponse we support the same functionality, plus they can
be left unset separately from each other.
  • Loading branch information
pohly committed Mar 4, 2021
1 parent 0600cb2 commit 7a2fcdd
Show file tree
Hide file tree
Showing 3 changed files with 324 additions and 252 deletions.
34 changes: 28 additions & 6 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -948,19 +948,41 @@ message GetCapacityResponse {
// The value of this field MUST NOT be negative.
int64 available_capacity = 1;

// The supported volume size that may be used in a CreateVolume call
// The largest size that may be used in a
// CreateVolumeRequest.capacity_range.required_bytes field
// to create a volume with the same parameters as those in
// GetCapacityRequest, given as a lower bound (`required_bytes`)
// and an upper bound (`limit_bytes`).
// GetCapacityRequest.
//
// If `volume_capabilities` or `parameters` is
// specified in the request, the Plugin SHALL take those into
// consideration when calculating the supported volume size of the
// consideration when calculating the minimum volume size of the
// storage.
//
// This field is OPTIONAL. COs MAY use it to make decision about
// This field is OPTIONAL. MUST NOT be negative.
// The Plugin SHOULD provide a value for this field if it has
// a maximum size for individual volumes and leave it unset
// otherwise. COs MAY use it to make decision about
// where to create volumes.
CapacityRange volume_size = 2 [(alpha_field) = true];
google.protobuf.Int64Value maximum_volume_size = 2
[(alpha_field) = true];

// The smallest size that may be used in a
// CreateVolumeRequest.capacity_range.limit_bytes field
// to create a volume with the same parameters as those in
// GetCapacityRequest.
//
// If `volume_capabilities` or `parameters` is
// specified in the request, the Plugin SHALL take those into
// consideration when calculating the maximum volume size of the
// storage.
//
// This field is OPTIONAL. MUST NOT be negative.
// The Plugin SHOULD provide a value for this field if it has
// a minimum size for individual volumes and leave it unset
// otherwise. COs MAY use it to make decision about
// where to create volumes.
google.protobuf.Int64Value minimum_volume_size = 3
[(alpha_field) = true];
}
message ControllerGetCapabilitiesRequest {
// Intentionally empty.
Expand Down
Loading

0 comments on commit 7a2fcdd

Please sign in to comment.