Skip to content

Commit

Permalink
lxc/storage/volume: Move volume if a destination cluster member name …
Browse files Browse the repository at this point in the history
…is set

This fixes a regression introduced in canonical#12348
which causes the `--destination-target` flag to be ignored. Instead if the destination
flag is set when renaming a volume, use the handler for volume movements.

When renaming a volume using `lxc storage volume move`, the args were
passed to the handler behind `lxc storage volume rename` which does not
support the `--destination-target` flag.

Signed-off-by: Julian Pelizäus <[email protected]>
  • Loading branch information
roosterfish committed Oct 18, 2023
1 parent b0099f3 commit 72e2084
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lxc/storage_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -1661,8 +1661,9 @@ func (c *cmdStorageVolumeMove) Run(cmd *cobra.Command, args []string) error {
return fmt.Errorf(i18n.G("No storage pool for target volume specified"))
}

// Rename volume if both remotes and pools of source and target are equal.
if srcRemote == dstRemote && srcVolPool == dstVolPool {
// Rename volume if both remotes and pools of source and target are equal
// and no destination cluster member name is set.
if srcRemote == dstRemote && srcVolPool == dstVolPool && c.storageVolume.flagDestinationTarget == "" {
var args []string

if srcRemote != "" {
Expand Down

0 comments on commit 72e2084

Please sign in to comment.