@@ -121,6 +121,10 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
121
121
return nil , status .Errorf (codes .OutOfRange , "Requested capacity %d exceeds maximum allowed %d" , capacity , maxStorageCapacity )
122
122
}
123
123
124
+ topologies := []* csi.Topology {& csi.Topology {
125
+ Segments : map [string ]string {TopologyKeyNode : cs .nodeID },
126
+ }}
127
+
124
128
// Need to check for already existing volume name, and if found
125
129
// check for the requested capacity and already allocated capacity
126
130
if exVol , err := getVolumeByName (req .GetName ()); err == nil {
@@ -148,10 +152,11 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
148
152
// TODO (sbezverk) Do I need to make sure that volume still exists?
149
153
return & csi.CreateVolumeResponse {
150
154
Volume : & csi.Volume {
151
- VolumeId : exVol .VolID ,
152
- CapacityBytes : int64 (exVol .VolSize ),
153
- VolumeContext : req .GetParameters (),
154
- ContentSource : req .GetVolumeContentSource (),
155
+ VolumeId : exVol .VolID ,
156
+ CapacityBytes : int64 (exVol .VolSize ),
157
+ VolumeContext : req .GetParameters (),
158
+ ContentSource : req .GetVolumeContentSource (),
159
+ AccessibleTopology : topologies ,
155
160
},
156
161
}, nil
157
162
}
@@ -190,10 +195,6 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
190
195
glog .V (4 ).Infof ("successfully populated volume %s" , vol .VolID )
191
196
}
192
197
193
- topologies := []* csi.Topology {& csi.Topology {
194
- Segments : map [string ]string {TopologyKeyNode : cs .nodeID },
195
- }}
196
-
197
198
return & csi.CreateVolumeResponse {
198
199
Volume : & csi.Volume {
199
200
VolumeId : volumeID ,
0 commit comments