Skip to content

Commit

Permalink
Populate published node IDs in ListVolumesResponse
Browse files Browse the repository at this point in the history
According to [1], this "helps the CO [container orchestrator] reconcile
the actual state when the volume may have been Unpublished from the node
out of band from the CO".

[1] container-storage-interface/spec#374
  • Loading branch information
Timo Reimann committed Dec 19, 2021
1 parent c3db7d6 commit 85acdfc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (
VolumeId: vol.ID,
CapacityBytes: vol.SizeGigaBytes * giB,
},
Status: &csi.ListVolumesResponse_VolumeStatus{
PublishedNodeIds: []string{vol.ID},
},
})
}

Expand Down Expand Up @@ -609,6 +612,7 @@ func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.Control
csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT,
csi.ControllerServiceCapability_RPC_LIST_SNAPSHOTS,
csi.ControllerServiceCapability_RPC_EXPAND_VOLUME,
csi.ControllerServiceCapability_RPC_LIST_VOLUMES_PUBLISHED_NODES,
} {
caps = append(caps, newCap(cap))
}
Expand Down

0 comments on commit 85acdfc

Please sign in to comment.