2018-03-05 11:59:47 +00:00
|
|
|
/*
|
2019-04-03 08:46:15 +00:00
|
|
|
Copyright 2018 The Ceph-CSI Authors.
|
2018-03-05 11:59:47 +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 cephfs
|
|
|
|
|
|
|
|
import (
|
2018-06-12 15:09:44 +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 18:48:36 +00:00
|
|
|
"github.com/container-storage-interface/spec/lib/go/csi"
|
2018-03-05 11:59:47 +00:00
|
|
|
)
|
|
|
|
|
2019-01-28 11:47:06 +00:00
|
|
|
// IdentityServer struct of ceph CSI driver with supported methods of CSI
|
|
|
|
// identity server spec.
|
2019-01-17 07:51:06 +00:00
|
|
|
type IdentityServer struct {
|
2018-03-05 11:59:47 +00:00
|
|
|
*csicommon.DefaultIdentityServer
|
|
|
|
}
|
2018-06-12 15:09:44 +00:00
|
|
|
|
2020-07-19 12:21:03 +00:00
|
|
|
// GetPluginCapabilities returns available capabilities of the ceph driver.
|
2021-06-25 10:18:59 +00:00
|
|
|
func (is *IdentityServer) GetPluginCapabilities(
|
|
|
|
ctx context.Context,
|
2022-06-01 10:17:19 +00:00
|
|
|
req *csi.GetPluginCapabilitiesRequest,
|
|
|
|
) (*csi.GetPluginCapabilitiesResponse, error) {
|
2018-06-12 15:09:44 +00:00
|
|
|
return &csi.GetPluginCapabilitiesResponse{
|
|
|
|
Capabilities: []*csi.PluginCapability{
|
|
|
|
{
|
|
|
|
Type: &csi.PluginCapability_Service_{
|
|
|
|
Service: &csi.PluginCapability_Service{
|
|
|
|
Type: csi.PluginCapability_Service_CONTROLLER_SERVICE,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-10-07 06:41:33 +00:00
|
|
|
{
|
|
|
|
Type: &csi.PluginCapability_VolumeExpansion_{
|
|
|
|
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
|
|
|
|
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-02-05 08:11:51 +00:00
|
|
|
{
|
|
|
|
Type: &csi.PluginCapability_Service_{
|
|
|
|
Service: &csi.PluginCapability_Service{
|
|
|
|
Type: csi.PluginCapability_Service_GROUP_CONTROLLER_SERVICE,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2018-06-12 15:09:44 +00:00
|
|
|
},
|
|
|
|
}, nil
|
|
|
|
}
|