Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new RPC and Cap to advertise the client details #75

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions fence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ service FenceController {
// ListClusterFence RPC call to provide a list of blocklisted/fenced clients.
rpc ListClusterFence(ListClusterFenceRequest)
returns (ListClusterFenceResponse){}

// GetFenceClients RPC calls to get the client information to use in a
// FenceClusterNetwork or UnfenceClusterNetwork RPC.
rpc GetFenceClients(GetFenceClientsRequest)
returns (GetFenceClientsResponse){}
}
```

Expand Down Expand Up @@ -145,6 +150,40 @@ message CIDR {
}
```

### GetFenceClients

```protobuf
// GetFenceClientsRequest contains the necessary information to identify
// the clients that need fencing.
message GetFenceClientsRequest {
// Plugin-specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 1;
// Secrets required by the plugin to complete the request.
map<string, string> secrets = 2 [(csi.v1.csi_secret) = true];
}

// GetFenceClientsResponse holds the information about clients that require
// fencing.
message GetFenceClientsResponse {
// List of clients that need to be fenced.
repeated ClientDetails clients = 1;
}
```

### ClientDetails

```protobuf
// ClientDetails holds the information about the client that requires fencing.
message ClientDetails {
// id represents the unique identifier of the client.
// Required field.
string id = 1;
// list of IP addresses that represent the client's local addresses.
// Required field.
repeated CIDR addresses = 2;
}
```

#### Error Scheme

| Condition | gRPC Code | Description | Recovery Behavior |
Expand Down
29 changes: 29 additions & 0 deletions fence/fence.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ service FenceController {
// ListClusterFence RPC call to provide a list of blocklisted/fenced clients.
rpc ListClusterFence(ListClusterFenceRequest)
returns (ListClusterFenceResponse){}

// GetFenceClients RPC calls to get the client information to use in a
// FenceClusterNetwork or UnfenceClusterNetwork RPC.
rpc GetFenceClients(GetFenceClientsRequest)
returns (GetFenceClientsResponse){}
}
// FenceClusterNetworkRequest contains the information needed to identify
// the storage cluster so that the appropriate fencing operation can be
Expand Down Expand Up @@ -78,3 +83,27 @@ message CIDR {
// CIDR block
string cidr = 1;
}
// GetFenceClientsRequest contains the necessary information to identify
// the clients that need fencing.
message GetFenceClientsRequest {
// Plugin-specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 1;
// Secrets required by the plugin to complete the request.
map<string, string> secrets = 2 [(csi.v1.csi_secret) = true];
}

// GetFenceClientsResponse holds the information about clients that require
// fencing.
message GetFenceClientsResponse {
// List of clients that need to be fenced.
repeated ClientDetails clients = 1;
}
// ClientDetails holds the information about the client that requires fencing.
message ClientDetails {
// id represents the unique identifier of the client.
// Required field.
string id = 1;
// list of IP addresses that represent the client's local addresses.
// Required field.
repeated CIDR addresses = 2;
}
7 changes: 7 additions & 0 deletions identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ message Capability {
// plugin can invoke RPCs that require access to the storage system,
// similar to the CSI Controller (provisioner).
NETWORK_FENCE = 1;

// GET_CLIENTS_TO_FENCE indicates that the CSI-driver provides RPCs for a
// GET_CLIENTS_TO_FENCE operation to get the clients to fence.
// The presence of this capability determines whether the CSI-Addons CO
// plugin can invoke RPCs that require access to the storage system,
// similar to the CSI Controller (provisioner).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the typos, however there is now clinets in the commit description 😆

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed now 🤦🏻

GET_CLIENTS_TO_FENCE = 2;
}
// type contains the Type of CSI Service that the CSI-driver supports.
Type type = 1;
Expand Down
7 changes: 7 additions & 0 deletions identity/identity.proto
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ message Capability {
// plugin can invoke RPCs that require access to the storage system,
// similar to the CSI Controller (provisioner).
NETWORK_FENCE = 1;

// GET_CLIENTS_TO_FENCE indicates that the CSI-driver provides RPCs for a
// GET_CLIENTS_TO_FENCE operation to get the clients to fence.
// The presence of this capability determines whether the CSI-Addons CO
// plugin can invoke RPCs that require access to the storage system,
// similar to the CSI Controller (provisioner).
GET_CLIENTS_TO_FENCE = 2;
}
// type contains the Type of CSI Service that the CSI-driver supports.
Type type = 1;
Expand Down
Loading