Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/csi/cinder/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewDriver(o *DriverOpts) *Driver {
klog.Info("Driver: ", d.name)
klog.Info("Driver version: ", d.fqVersion)
klog.Info("CSI Spec version: ", specVersion)
klog.Infof("Topology awareness: %T", d.withTopology)
klog.Infof("Topology awareness: %t", d.withTopology)

d.AddControllerServiceCapabilities(
[]csi.ControllerServiceCapability_RPC_Type{
Expand Down
51 changes: 27 additions & 24 deletions pkg/csi/cinder/identityserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,39 @@ func (ids *identityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*c

func (ids *identityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
klog.V(5).Infof("GetPluginCapabilities called with req %+v", req)
return &csi.GetPluginCapabilitiesResponse{
Capabilities: []*csi.PluginCapability{
{
Type: &csi.PluginCapability_Service_{
Service: &csi.PluginCapability_Service{
Type: csi.PluginCapability_Service_CONTROLLER_SERVICE,
},
caps := []*csi.PluginCapability{
{
Type: &csi.PluginCapability_Service_{
Service: &csi.PluginCapability_Service{
Type: csi.PluginCapability_Service_CONTROLLER_SERVICE,
},
},
{
Type: &csi.PluginCapability_Service_{
Service: &csi.PluginCapability_Service{
Type: csi.PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS,
},
},
{
Type: &csi.PluginCapability_VolumeExpansion_{
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
},
},
{
Type: &csi.PluginCapability_VolumeExpansion_{
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
},
},
{
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_OFFLINE,
},
},
}

if ids.Driver.withTopology {
caps = append(caps, &csi.PluginCapability{
Type: &csi.PluginCapability_Service_{
Service: &csi.PluginCapability_Service{
Type: csi.PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS,
},
},
},
}, nil
})
}

return &csi.GetPluginCapabilitiesResponse{Capabilities: caps}, nil
}
1 change: 1 addition & 0 deletions pkg/csi/manila/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func NewDriver(o *DriverOpts) (*Driver, error) {
klog.Info("Driver: ", d.name)
klog.Info("Driver version: ", d.fqVersion)
klog.Info("CSI spec version: ", specVersion)
klog.Infof("Topology awareness: %t", d.withTopology)

getShareAdapter(d.shareProto) // The program will terminate with a non-zero exit code if the share protocol selector is wrong
klog.Infof("Operating on %s shares", d.shareProto)
Expand Down
8 changes: 8 additions & 0 deletions pkg/csi/manila/identityserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ import (
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"k8s.io/klog/v2"
)

type identityServer struct {
d *Driver
}

func (ids *identityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
klog.V(5).Infof("Using default GetPluginInfo")

if ids.d.name == "" {
return nil, status.Error(codes.Unavailable, "Driver name not configured")
}

if ids.d.fqVersion == "" {
return nil, status.Error(codes.Unavailable, "Driver is missing version")
}

return &csi.GetPluginInfoResponse{
Name: ids.d.name,
VendorVersion: ids.d.fqVersion,
Expand All @@ -50,6 +57,7 @@ func (ids *identityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*c
}

func (ids *identityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
klog.V(5).Infof("GetPluginCapabilities called with req %+v", req)
caps := []*csi.PluginCapability{
{
Type: &csi.PluginCapability_Service_{
Expand Down