diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-19 02:59:45 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-19 02:59:45 -0700 |
| commit | b21fb2e2b62dd9ec3cf13403e87687229424f1e0 (patch) | |
| tree | 9b2d9987e9c431cb52d5b13369928fb128960cb3 /pkg/driver/identityserver.go | |
| download | seaweedfs-csi-driver-b21fb2e2b62dd9ec3cf13403e87687229424f1e0.tar.xz seaweedfs-csi-driver-b21fb2e2b62dd9ec3cf13403e87687229424f1e0.zip | |
WIP
Diffstat (limited to 'pkg/driver/identityserver.go')
| -rw-r--r-- | pkg/driver/identityserver.go | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/pkg/driver/identityserver.go b/pkg/driver/identityserver.go new file mode 100644 index 0000000..f92b225 --- /dev/null +++ b/pkg/driver/identityserver.go @@ -0,0 +1,49 @@ +package driver + +import ( + "github.com/container-storage-interface/spec/lib/go/csi" + "github.com/golang/glog" + "golang.org/x/net/context" +) + +type IdentityServer struct { + Driver *SeaweedFsDriver +} + +var _ = csi.IdentityServer(&IdentityServer{}) + +func (ids *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) { + + return &csi.GetPluginInfoResponse{ + Name: ids.Driver.name, + VendorVersion: ids.Driver.version, + }, nil +} + +func (ids *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error) { + return &csi.ProbeResponse{}, nil +} + +func (ids *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) { + glog.V(4).Infof("Using default capabilities") + return &csi.GetPluginCapabilitiesResponse{ + Capabilities: []*csi.PluginCapability{ + { + Type: &csi.PluginCapability_Service_{ + Service: &csi.PluginCapability_Service{ + Type: csi.PluginCapability_Service_CONTROLLER_SERVICE, + }, + }, + }, + /* // TODO add later + { + Type: &csi.PluginCapability_VolumeExpansion_{ + VolumeExpansion: &csi.PluginCapability_VolumeExpansion{ + Type: csi.PluginCapability_VolumeExpansion_ONLINE, + }, + }, + }, + */ + }, + }, nil +} |
