Skip to content

Commit

Permalink
Fix for No Volumes Avai for some commmands
Browse files Browse the repository at this point in the history
This patch updates REX-Ray to request a volume's attachments if a CLI
command is executed that depends upon a volume's status to determine its
candidacy for said operation. For example, only "available" volumes
(those not attached to another host) can be attached to a host. Only
volumes that are "attached" can be detached.

This patch handles issue 610
(rexray#610) and part of issue 609
(rexray#609).
  • Loading branch information
akutz committed Oct 31, 2016
1 parent da81e4b commit 7242ad3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/cli/cmds_volume.go
Expand Up @@ -800,6 +800,12 @@ func (c *CLI) lsVolumes(
args []string,
validStatuses ...string) (*lsVolumesResult, error) {

// if the volume status matters then send the flag that requests a
// volume's attachment information
if len(validStatuses) > 0 {
c.volumeAttached = true
}

opts := &apitypes.VolumesOpts{Attachments: c.volumeAttached}
vols, err := c.r.Storage().Volumes(c.ctx, opts)
if err != nil {
Expand Down

0 comments on commit 7242ad3

Please sign in to comment.