mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
Add topology support to ceph-csi
Signed-off-by: ShyamsundarR <srangana@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
5475022bc3
commit
5c4abf8347
@ -30,8 +30,10 @@ type CSIDriver struct {
|
||||
name string
|
||||
nodeID string
|
||||
version string
|
||||
cap []*csi.ControllerServiceCapability
|
||||
vc []*csi.VolumeCapability_AccessMode
|
||||
// topology constraints that this nodeserver will advertise
|
||||
topology map[string]string
|
||||
cap []*csi.ControllerServiceCapability
|
||||
vc []*csi.VolumeCapability_AccessMode
|
||||
}
|
||||
|
||||
// NewCSIDriver Creates a NewCSIDriver object. Assumes vendor
|
||||
|
@ -57,8 +57,13 @@ func (ns *DefaultNodeServer) NodeExpandVolume(ctx context.Context, req *csi.Node
|
||||
func (ns *DefaultNodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
|
||||
klog.V(5).Infof(util.Log(ctx, "Using default NodeGetInfo"))
|
||||
|
||||
csiTopology := &csi.Topology{
|
||||
Segments: ns.Driver.topology,
|
||||
}
|
||||
|
||||
return &csi.NodeGetInfoResponse{
|
||||
NodeId: ns.Driver.nodeID,
|
||||
NodeId: ns.Driver.nodeID,
|
||||
AccessibleTopology: csiTopology,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,8 @@ func NewVolumeCapabilityAccessMode(mode csi.VolumeCapability_AccessMode_Mode) *c
|
||||
}
|
||||
|
||||
// NewDefaultNodeServer initializes default node server
|
||||
func NewDefaultNodeServer(d *CSIDriver, t string) *DefaultNodeServer {
|
||||
func NewDefaultNodeServer(d *CSIDriver, t string, topology map[string]string) *DefaultNodeServer {
|
||||
d.topology = topology
|
||||
return &DefaultNodeServer{
|
||||
Driver: d,
|
||||
Type: t,
|
||||
|
Reference in New Issue
Block a user