Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxc: Handle volume rename in lxc storage volume move command #12348

Merged

Conversation

monstermunchkin
Copy link
Contributor

When calling lxc storage volume move it internally always calls lxc storage volume copy. This in itself is not a problem. However, the
copy handler expects LXD to always return an OperationResponse. This
doesn't happen though as LXD will return a SyncResponse if it detects
a move request.

This changes the move handler to call lxc storage volume rename if
it detects a rename request, instead of passing it to the copy
handler.

Fixes #12344

Signed-off-by: Thomas Hipp [email protected]

When calling `lxc storage volume move` it internally always calls `lxc
storage volume copy`. This in itself is not a problem. However, the
`copy` handler expects LXD to always return an `OperationResponse`. This
doesn't happen though as LXD will return a `SyncResponse` if it detects
a move request.

This changes the `move` handler to call `lxc storage volume rename` if
it detects a rename request, instead of passing it to the `copy`
handler.

Fixes canonical#12344

Signed-off-by: Thomas Hipp <[email protected]>
@tomponline tomponline merged commit 1fea376 into canonical:main Oct 6, 2023
25 checks passed
roosterfish added a commit to roosterfish/lxd that referenced this pull request Oct 18, 2023
…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]>
roosterfish added a commit to roosterfish/lxd that referenced this pull request Oct 18, 2023
…is set

This fixes a regression introduced in canonical#12348
which causes the `--destination-target` flag to be ignored.

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.

Instead if the destination flag is set when renaming a volume, use the handler for volume movements.

Signed-off-by: Julian Pelizäus <[email protected]>
roosterfish added a commit to roosterfish/lxd that referenced this pull request Nov 9, 2023
This fixes a regression introduced in canonical#12348.
When the target project flag is set don't use the function for renaming volumes.

Signed-off-by: Julian Pelizäus <[email protected]>
tomponline pushed a commit to tomponline/lxd that referenced this pull request Dec 5, 2023
…is set

This fixes a regression introduced in canonical#12348
which causes the `--destination-target` flag to be ignored.

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.

Instead if the destination flag is set when renaming a volume, use the handler for volume movements.

Signed-off-by: Julian Pelizäus <[email protected]>
tomponline pushed a commit to tomponline/lxd that referenced this pull request Dec 5, 2023
…is set

This fixes a regression introduced in canonical#12348
which causes the `--destination-target` flag to be ignored.

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.

Instead if the destination flag is set when renaming a volume, use the handler for volume movements.

Signed-off-by: Julian Pelizäus <[email protected]>
tomponline pushed a commit to tomponline/lxd that referenced this pull request Dec 13, 2023
This fixes a regression introduced in canonical#12348.
When the target project flag is set don't use the function for renaming volumes.

Signed-off-by: Julian Pelizäus <[email protected]>
tomponline pushed a commit to tomponline/lxd that referenced this pull request Dec 13, 2023
This fixes a regression introduced in canonical#12348.
When the target project flag is set don't use the function for renaming volumes.

Signed-off-by: Julian Pelizäus <[email protected]>
ganto pushed a commit to ganto/lxd that referenced this pull request May 8, 2024
This fixes a regression introduced in canonical#12348.
When the target project flag is set don't use the function for renaming volumes.

Signed-off-by: Julian Pelizäus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to rename custom storage volume
2 participants