-
Notifications
You must be signed in to change notification settings - Fork 2
/
identity.go
61 lines (55 loc) · 1.59 KB
/
identity.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (C) 2016--2020 Lightbits Labs Ltd.
// SPDX-License-Identifier: Apache-2.0
package driver
import (
"context"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/protobuf/ptypes/wrappers"
)
func (d *Driver) GetPluginInfo( //revive:disable-line:unused-receiver
_ context.Context, _ *csi.GetPluginInfoRequest,
) (*csi.GetPluginInfoResponse, error) {
return &csi.GetPluginInfoResponse{
Name: driverName,
VendorVersion: version,
}, nil
}
func (d *Driver) GetPluginCapabilities( //revive:disable-line:unused-receiver
_ context.Context, _ *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,
},
},
},
{
Type: &csi.PluginCapability_VolumeExpansion_{
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
Type: csi.PluginCapability_VolumeExpansion_OFFLINE,
},
},
},
{
Type: &csi.PluginCapability_VolumeExpansion_{
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
},
},
},
},
}, nil
}
func (d *Driver) Probe( //revive:disable-line:unused-receiver
_ context.Context, _ *csi.ProbeRequest,
) (*csi.ProbeResponse, error) {
return &csi.ProbeResponse{
// to appease Rex, who cares - despite it being optional!
Ready: &wrappers.BoolValue{
Value: true,
},
}, nil
}