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 Mar 17, 2020
1 parent d7c1533 commit 4c518ab
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 @@ -261,6 +261,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 4c518ab

Please sign in to comment.