Skip to content

Commit

Permalink
Add force detach
Browse files Browse the repository at this point in the history
Add new controller capability:
* UNPUBLISH_FENCE

Add new node capabilitiy:
* FORCE_UNPUBLISH
  • Loading branch information
bswartz committed Apr 26, 2021
1 parent da58351 commit d6966c8
Show file tree
Hide file tree
Showing 3 changed files with 413 additions and 280 deletions.
35 changes: 34 additions & 1 deletion csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,18 @@ message ControllerUnpublishVolumeRequest {
// This field is OPTIONAL. Refer to the `Secrets Requirements`
// section on how to use this field.
map<string, string> secrets = 3 [(csi_secret) = true];
}

// Indicates SP MUST make the volume inacessible to the node or nodes
// it is being unpublished from. Any attempt to read or write data
// to a volume from a node that has been fenced MUST NOT succeed,
// even if the volume remains staged and/or published on the node.
// CO MUST NOT set this field to true unless SP has the
// UNPUBLISH_FENCE controller capability.
// The SP MAY make the volume inaccessible even when this field is
// false.
// This is an OPTIONAL field.
bool fence = 4;
}
message ControllerUnpublishVolumeResponse {
// Intentionally empty.
}
Expand Down Expand Up @@ -1044,6 +1054,10 @@ message ControllerServiceCapability {
// This enables COs to, for example, fetch per volume
// condition after a volume is provisioned.
GET_VOLUME = 12 [(alpha_enum_value) = true];

// Indicates the SP supports ControllerUnpublishVolume.fence
// field.
UNPUBLISH_FENCE = 13;
}

Type type = 1;
Expand Down Expand Up @@ -1281,6 +1295,13 @@ message NodeUnstageVolumeRequest {
// system/filesystem, but, at a minimum, SP MUST accept a max path
// length of at least 128 bytes.
string staging_target_path = 2;

// Indicates that the SP should prefer to successfully unstage the
// volume, even if data loss would occur as a result.
// CO MUST NOT set this field to true unless SP has the
// FORCE_UNPUBLISH node capability.
// This in an OPTIONAL field.
bool force = 3;
}

message NodeUnstageVolumeResponse {
Expand Down Expand Up @@ -1365,6 +1386,13 @@ message NodeUnpublishVolumeRequest {
// system/filesystem, but, at a minimum, SP MUST accept a max path
// length of at least 128 bytes.
string target_path = 2;

// Indicates that the SP should prefer to successfully unpublish the
// volume, even if data loss would occur as a result.
// CO MUST NOT set this field to true unless SP has the
// FORCE_UNPUBLISH node capability.
// This in an OPTIONAL field.
bool force = 3;
}

message NodeUnpublishVolumeResponse {
Expand Down Expand Up @@ -1476,6 +1504,11 @@ message NodeServiceCapability {
// Note that, for alpha, `VolumeCondition` is intended to be
// informative for humans only, not for automation.
VOLUME_CONDITION = 4 [(alpha_enum_value) = true];
// Indicates that the node supports the NodeUnpublishVolume.force
// field. Also indicates that the node supports the
// NodeUnstageVolume.force field if it also has the
// STAGE_UNSTAGE_VOLUME capability.
FORCE_UNPUBLISH = 5;
}

Type type = 1;
Expand Down
Loading

0 comments on commit d6966c8

Please sign in to comment.