mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
csiaddons: register volumegroup controller
Register the volumegroup controller as part of rbd controller server to serve the volume group RPC spec. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
6e5de23674
commit
2dd2ac8e91
@ -96,6 +96,24 @@ func (is *IdentityServer) GetCapabilities(
|
||||
Type: identity.Capability_VolumeReplication_VOLUME_REPLICATION,
|
||||
},
|
||||
},
|
||||
}, &identity.Capability{
|
||||
Type: &identity.Capability_VolumeGroup_{
|
||||
VolumeGroup: &identity.Capability_VolumeGroup{
|
||||
Type: identity.Capability_VolumeGroup_VOLUME_GROUP,
|
||||
},
|
||||
},
|
||||
}, &identity.Capability{
|
||||
Type: &identity.Capability_VolumeGroup_{
|
||||
VolumeGroup: &identity.Capability_VolumeGroup{
|
||||
Type: identity.Capability_VolumeGroup_MODIFY_VOLUME_GROUP,
|
||||
},
|
||||
},
|
||||
}, &identity.Capability{
|
||||
Type: &identity.Capability_VolumeGroup_{
|
||||
VolumeGroup: &identity.Capability_VolumeGroup{
|
||||
Type: identity.Capability_VolumeGroup_LIMIT_VOLUME_TO_ONE_VOLUME_GROUP,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
46
internal/csi-addons/rbd/volumegroup.go
Normal file
46
internal/csi-addons/rbd/volumegroup.go
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2024 The Ceph-CSI Authors.
|
||||
|
||||
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 (
|
||||
corerbd "github.com/ceph/ceph-csi/internal/rbd"
|
||||
|
||||
"github.com/csi-addons/spec/lib/go/volumegroup"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// VolumeGroupServer struct of rbd CSI driver with supported methods of VolumeGroup
|
||||
// controller server spec.
|
||||
type VolumeGroupServer struct {
|
||||
// added UnimplementedControllerServer as a member of
|
||||
// ControllerServer. if volumegroup spec add more RPC services in the proto
|
||||
// file, then we don't need to add all RPC methods leading to forward
|
||||
// compatibility.
|
||||
*volumegroup.UnimplementedControllerServer
|
||||
// Embed ControllerServer as it implements helper functions
|
||||
*corerbd.ControllerServer
|
||||
}
|
||||
|
||||
// NewVolumeGroupServer creates a new VolumeGroupServer which handles
|
||||
// the VolumeGroup Service requests from the CSI-Addons specification.
|
||||
func NewVolumeGroupServer(c *corerbd.ControllerServer) *VolumeGroupServer {
|
||||
return &VolumeGroupServer{ControllerServer: c}
|
||||
}
|
||||
|
||||
func (vs *VolumeGroupServer) RegisterService(server grpc.ServiceRegistrar) {
|
||||
volumegroup.RegisterControllerServer(server, vs)
|
||||
}
|
@ -221,6 +221,9 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error {
|
||||
|
||||
rcs := casrbd.NewReplicationServer(NewControllerServer(r.cd))
|
||||
r.cas.RegisterService(rcs)
|
||||
|
||||
vgcs := casrbd.NewVolumeGroupServer(NewControllerServer(r.cd))
|
||||
r.cas.RegisterService(vgcs)
|
||||
}
|
||||
|
||||
if conf.IsNodeServer {
|
||||
|
Reference in New Issue
Block a user