Conversation
simondeziel
commented
Jun 4, 2025
kadinsayani
requested changes
Jun 4, 2025
lxd/profiles_utils.go
Outdated
| ) | ||
|
|
||
| func doProfileUpdate(s *state.State, p api.Project, profileName string, id int64, profile *api.Profile, req api.ProfilePut) error { | ||
| func doProfileUpdate(s *state.State, p api.Project, profileName string, profile *api.Profile, req api.ProfilePut) error { |
Member
There was a problem hiding this comment.
I think we can use id in the below database transactions:
Member
There was a problem hiding this comment.
It might be worth checking if id is already available at the call sites. We should minimize calls to cluster.GetProfileID().
Member
Author
There was a problem hiding this comment.
Line 95 in 74f662d
cluster.UpdateProfile() which immediately get the profile ID: https://github.com/canonical/lxd/blob/main/lxd/db/cluster/profiles.mapper.go#L479 ... only to get it again later. This being in a .mapper.go makes it a bit more annoying to fix.
I think I'll back down on those changes as this sounds like it require more work than I'm willing to do ATM.
Member
Author
There was a problem hiding this comment.
@kadinsayani I think you've found a good thing to look at more closely but I'm just saying that I don't have the cycles to do that ATM ;)
a9b23d3 to
850028b
Compare
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Also stop exporting that function that is only used locally. Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
…ncePostClusteringMigrateWithRemoteStorage` Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
…lustering()` Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
…AAS()` Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
…aemon()` Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.