@@ -41,6 +41,8 @@ const (
41
41
)
42
42
43
43
const (
44
+ PublishInfoVolumeName = "com.digitalocean.csi/volume-name"
45
+
44
46
defaultVolumeSizeInGB = 16 * GB
45
47
46
48
createdByDO = "Created by DigitalOcean CSI driver"
@@ -253,7 +255,11 @@ func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.Controlle
253
255
attachedID = id
254
256
if id == dropletID {
255
257
ll .Info ("volume is already attached" )
256
- return & csi.ControllerPublishVolumeResponse {}, nil
258
+ return & csi.ControllerPublishVolumeResponse {
259
+ PublishInfo : map [string ]string {
260
+ PublishInfoVolumeName : vol .Name ,
261
+ },
262
+ }, nil
257
263
}
258
264
}
259
265
@@ -273,7 +279,11 @@ func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.Controlle
273
279
"error" : err ,
274
280
"resp" : resp ,
275
281
}).Warn ("assuming volume is attached already" )
276
- return & csi.ControllerPublishVolumeResponse {}, nil
282
+ return & csi.ControllerPublishVolumeResponse {
283
+ PublishInfo : map [string ]string {
284
+ PublishInfoVolumeName : vol .Name ,
285
+ },
286
+ }, nil
277
287
}
278
288
279
289
if strings .Contains (err .Error (), "Droplet already has a pending event" ) {
@@ -297,7 +307,11 @@ func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.Controlle
297
307
}
298
308
299
309
ll .Info ("volume is attached" )
300
- return & csi.ControllerPublishVolumeResponse {}, nil
310
+ return & csi.ControllerPublishVolumeResponse {
311
+ PublishInfo : map [string ]string {
312
+ PublishInfoVolumeName : vol .Name ,
313
+ },
314
+ }, nil
301
315
}
302
316
303
317
// ControllerUnpublishVolume deattaches the given volume from the node
0 commit comments