util: add GroupControllerGetCapabilities RPC

added GroupControllerGetCapabilities RPC
to the default controller server which returns
the group capabilities which are already set.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2024-02-05 09:35:04 +01:00 committed by mergify[bot]
parent aa39b3dc1f
commit 12bd269d5b

View File

@ -47,3 +47,19 @@ func (cs *DefaultControllerServer) ControllerGetCapabilities(
Capabilities: cs.Driver.capabilities, Capabilities: cs.Driver.capabilities,
}, nil }, nil
} }
// GroupControllerGetCapabilities implements the default
// GroupControllerGetCapabilities GRPC callout.
func (cs *DefaultControllerServer) GroupControllerGetCapabilities(
ctx context.Context,
req *csi.GroupControllerGetCapabilitiesRequest,
) (*csi.GroupControllerGetCapabilitiesResponse, error) {
log.TraceLog(ctx, "Using default GroupControllerGetCapabilities")
if cs.Driver == nil {
return nil, status.Error(codes.Unimplemented, "Group controller server is not enabled")
}
return &csi.GroupControllerGetCapabilitiesResponse{
Capabilities: cs.Driver.groupCapabilities,
}, nil
}