Skip to content

Conversation

@simondeziel
Copy link
Member

No description provided.

)

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth checking if id is already available at the call sites. We should minimize calls to cluster.GetProfileID().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err = cluster.UpdateProfile(ctx, tx.Tx(), p.Name, profileName, cluster.Profile{
calls 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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 ;)

@simondeziel simondeziel force-pushed the misc-tweaks branch 2 times, most recently from a9b23d3 to 850028b Compare June 4, 2025 22:23
Copy link
Member

@kadinsayani kadinsayani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@simondeziel simondeziel marked this pull request as ready for review June 5, 2025 20:12
@simondeziel simondeziel requested a review from tomponline June 5, 2025 20:13
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@tomponline tomponline merged commit b9f83ef into canonical:main Jun 6, 2025
30 checks passed
@simondeziel simondeziel deleted the misc-tweaks branch June 6, 2025 15:40
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.

3 participants