49 lines
1.0 KiB
Go
49 lines
1.0 KiB
Go
package service
|
|
|
|
import (
|
|
"golang.org/x/net/context"
|
|
|
|
"github.com/container-storage-interface/spec/lib/go/csi/v0"
|
|
"github.com/golang/protobuf/ptypes/wrappers"
|
|
)
|
|
|
|
func (s *service) GetPluginInfo(
|
|
ctx context.Context,
|
|
req *csi.GetPluginInfoRequest) (
|
|
*csi.GetPluginInfoResponse, error) {
|
|
|
|
return &csi.GetPluginInfoResponse{
|
|
Name: Name,
|
|
VendorVersion: VendorVersion,
|
|
Manifest: Manifest,
|
|
}, nil
|
|
}
|
|
|
|
func (s *service) Probe(
|
|
ctx context.Context,
|
|
req *csi.ProbeRequest) (
|
|
*csi.ProbeResponse, error) {
|
|
|
|
return &csi.ProbeResponse{
|
|
Ready: &wrappers.BoolValue{Value: true},
|
|
}, nil
|
|
}
|
|
|
|
func (s *service) GetPluginCapabilities(
|
|
ctx context.Context,
|
|
req *csi.GetPluginCapabilitiesRequest) (
|
|
*csi.GetPluginCapabilitiesResponse, error) {
|
|
|
|
return &csi.GetPluginCapabilitiesResponse{
|
|
Capabilities: []*csi.PluginCapability{
|
|
{
|
|
Type: &csi.PluginCapability_Service_{
|
|
Service: &csi.PluginCapability_Service{
|
|
Type: csi.PluginCapability_Service_CONTROLLER_SERVICE,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}, nil
|
|
}
|