Skip to content

Commit

Permalink
Support reconcile volume attachements
Browse files Browse the repository at this point in the history
  • Loading branch information
takmatsu committed Apr 27, 2020
1 parent be10107 commit 6dfb9b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/csi/cinder/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ func (cs *controllerServer) ListVolumes(ctx context.Context, req *csi.ListVolume
CapacityBytes: int64(v.Size * 1024 * 1024 * 1024),
},
}

status := &csi.ListVolumesResponse_VolumeStatus{}
for _, attachment := range v.Attachments {
status.PublishedNodeIds = append(status.PublishedNodeIds, attachment.ServerID)
}
ventry.Status = status

ventries = append(ventries, &ventry)
}
return &csi.ListVolumesResponse{
Expand Down
1 change: 1 addition & 0 deletions pkg/csi/cinder/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func NewDriver(nodeID, endpoint, cluster string) *CinderDriver {
csi.ControllerServiceCapability_RPC_LIST_SNAPSHOTS,
csi.ControllerServiceCapability_RPC_EXPAND_VOLUME,
csi.ControllerServiceCapability_RPC_CLONE_VOLUME,
csi.ControllerServiceCapability_RPC_LIST_VOLUMES_PUBLISHED_NODES,
})
d.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER})

Expand Down

0 comments on commit 6dfb9b4

Please sign in to comment.