Skip to content

Commit 9f181e6

Browse files
committed
cinder-csi-plugin: Don't report topology capability when --with-topology=False
The 'PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS' capability flag determines whether the provisioner attempts to look up topology information from the node or not [1][2]. If we report it but don't return topology information from the node, we end up with failures to provision [3]. Fix the issue by optionally reporting the capability, like Manila already does. [1] https://github.com/kubernetes-csi/external-provisioner/blob/17e2429e9f/pkg/controller/controller.go#L685-L700 [2] https://github.com/kubernetes-csi/external-provisioner/blob/17e2429e9f/pkg/controller/controller.go#L994-L996 [3] https://github.com/kubernetes-csi/external-provisioner/blob/17e2429e9f/pkg/controller/topology.go#L177 Signed-off-by: Stephen Finucane <[email protected]>
1 parent fa620a1 commit 9f181e6

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

pkg/csi/cinder/identityserver.go

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,39 @@ func (ids *identityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*c
5252

5353
func (ids *identityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
5454
klog.V(5).Infof("GetPluginCapabilities called with req %+v", req)
55-
return &csi.GetPluginCapabilitiesResponse{
56-
Capabilities: []*csi.PluginCapability{
57-
{
58-
Type: &csi.PluginCapability_Service_{
59-
Service: &csi.PluginCapability_Service{
60-
Type: csi.PluginCapability_Service_CONTROLLER_SERVICE,
61-
},
55+
caps := []*csi.PluginCapability{
56+
{
57+
Type: &csi.PluginCapability_Service_{
58+
Service: &csi.PluginCapability_Service{
59+
Type: csi.PluginCapability_Service_CONTROLLER_SERVICE,
6260
},
6361
},
64-
{
65-
Type: &csi.PluginCapability_Service_{
66-
Service: &csi.PluginCapability_Service{
67-
Type: csi.PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS,
68-
},
62+
},
63+
{
64+
Type: &csi.PluginCapability_VolumeExpansion_{
65+
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
66+
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
6967
},
7068
},
71-
{
72-
Type: &csi.PluginCapability_VolumeExpansion_{
73-
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
74-
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
75-
},
69+
},
70+
{
71+
Type: &csi.PluginCapability_VolumeExpansion_{
72+
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
73+
Type: csi.PluginCapability_VolumeExpansion_OFFLINE,
7674
},
7775
},
78-
{
79-
Type: &csi.PluginCapability_VolumeExpansion_{
80-
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
81-
Type: csi.PluginCapability_VolumeExpansion_OFFLINE,
82-
},
76+
},
77+
}
78+
79+
if ids.Driver.withTopology {
80+
caps = append(caps, &csi.PluginCapability{
81+
Type: &csi.PluginCapability_Service_{
82+
Service: &csi.PluginCapability_Service{
83+
Type: csi.PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS,
8384
},
8485
},
85-
},
86-
}, nil
86+
})
87+
}
88+
89+
return &csi.GetPluginCapabilitiesResponse{Capabilities: caps}, nil
8790
}

0 commit comments

Comments
 (0)