-
Notifications
You must be signed in to change notification settings - Fork 931
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
Support server side copy/move of custom storage volumes in clusters #12386
Support server side copy/move of custom storage volumes in clusters #12386
Conversation
5166e54
to
8db2b54
Compare
As discussed, lets lose the target group selection logic and always expect a specific cluster member name for target. |
08b85cf
to
bfd97e2
Compare
@monstermunchkin please can you rebase and push again as the tests didnt run for some reason |
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
bfd97e2
to
b7e758a
Compare
if err != nil { | ||
// Check if the user provided an incorrect target query parameter and return a helpful error message. | ||
_, volumeNotFound := api.StatusErrorMatch(err, http.StatusNotFound) | ||
targetIsSet := r.URL.Query().Get("target") != "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the same as testing target := queryParam(r, "target")
from line 1136?
serverIsClustered, _ := lxdCluster.Enabled(s.DB.Node) | ||
|
||
if serverIsClustered && targetIsSet && volumeNotFound { | ||
return response.NotFound(fmt.Errorf("Storage volume not found on this cluster member")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im a bit confused by this error as its only for ceph volumes that are not member specific?
// Check if the user provided an incorrect target query parameter and return a helpful error message. | ||
_, volumeNotFound := api.StatusErrorMatch(err, http.StatusNotFound) | ||
targetIsSet := r.URL.Query().Get("target") != "" | ||
serverIsClustered, _ := lxdCluster.Enabled(s.DB.Node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we doing this again here, it was ascertain on line 1139?
@@ -555,8 +555,10 @@ func (r *ProtocolLXD) CopyStoragePoolVolume(pool string, source InstanceServer, | |||
return nil, fmt.Errorf("Failed to get destination connection info: %w", err) | |||
} | |||
|
|||
clusterInternalVolumeCopy := r.CheckExtension("cluster_internal_custom_volume_copy") == nil | |||
|
|||
// Copy the storage pool volume locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment needs updating now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you follow up with those requested changes as a separate PR?
Fixes #11445