2018-01-09 18:59:50 +00:00
|
|
|
/*
|
2019-04-03 08:46:15 +00:00
|
|
|
Copyright 2018 The Ceph-CSI Authors.
|
2018-01-09 18:59:50 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package rbd
|
|
|
|
|
|
|
|
import (
|
2018-06-13 07:14:15 +00:00
|
|
|
"context"
|
|
|
|
|
2020-04-17 09:23:49 +00:00
|
|
|
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
|
2019-02-18 11:30:28 +00:00
|
|
|
|
2018-11-24 19:18:24 +00:00
|
|
|
"github.com/container-storage-interface/spec/lib/go/csi"
|
2018-01-09 18:59:50 +00:00
|
|
|
)
|
|
|
|
|
2019-01-28 11:47:06 +00:00
|
|
|
// IdentityServer struct of rbd CSI driver with supported methods of CSI
|
|
|
|
// identity server spec.
|
2019-01-17 07:51:06 +00:00
|
|
|
type IdentityServer struct {
|
2018-01-09 18:59:50 +00:00
|
|
|
*csicommon.DefaultIdentityServer
|
|
|
|
}
|
2018-06-13 07:14:15 +00:00
|
|
|
|
2020-07-19 12:21:03 +00:00
|
|
|
// GetPluginCapabilities returns available capabilities of the rbd driver.
|
2019-01-17 07:51:06 +00:00
|
|
|
func (is *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
|
2018-06-13 07:14:15 +00:00
|
|
|
return &csi.GetPluginCapabilitiesResponse{
|
|
|
|
Capabilities: []*csi.PluginCapability{
|
|
|
|
{
|
|
|
|
Type: &csi.PluginCapability_Service_{
|
|
|
|
Service: &csi.PluginCapability_Service{
|
|
|
|
Type: csi.PluginCapability_Service_CONTROLLER_SERVICE,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-11-27 12:14:31 +00:00
|
|
|
{
|
|
|
|
Type: &csi.PluginCapability_VolumeExpansion_{
|
|
|
|
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
|
|
|
|
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-01-24 16:26:56 +00:00
|
|
|
{
|
|
|
|
Type: &csi.PluginCapability_Service_{
|
|
|
|
Service: &csi.PluginCapability_Service{
|
|
|
|
Type: csi.PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2018-06-13 07:14:15 +00:00
|
|
|
},
|
|
|
|
}, nil
|
|
|
|
}
|