util: add helper for group controller

Added helper function to add the group
controller capabilities which needs to
be included by csi driver that wants to
implement group controller.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2024-02-05 09:29:56 +01:00
committed by mergify[bot]
parent dd235d88e0
commit aa39b3dc1f
2 changed files with 29 additions and 3 deletions

View File

@ -95,6 +95,18 @@ func NewControllerServiceCapability(ctrlCap csi.ControllerServiceCapability_RPC_
}
}
// NewGroupControllerServiceCapability returns group controller capabilities.
func NewGroupControllerServiceCapability(ctrlCap csi.GroupControllerServiceCapability_RPC_Type,
) *csi.GroupControllerServiceCapability {
return &csi.GroupControllerServiceCapability{
Type: &csi.GroupControllerServiceCapability_Rpc{
Rpc: &csi.GroupControllerServiceCapability_RPC{
Type: ctrlCap,
},
},
}
}
// NewMiddlewareServerOption creates a new grpc.ServerOption that configures a
// common format for log messages and other gRPC related handlers.
func NewMiddlewareServerOption() grpc.ServerOption {