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

Misc fixes #14714

Merged
merged 49 commits into from
Jan 9, 2025
Merged

Misc fixes #14714

merged 49 commits into from
Jan 9, 2025

Conversation

simondeziel
Copy link
Member

No description provided.

@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Dec 20, 2024
@simondeziel simondeziel marked this pull request as ready for review December 22, 2024 16:19
lxd/db/instances.go Outdated Show resolved Hide resolved
lxd/db/instances.go Outdated Show resolved Hide resolved
lxc/completion.go Outdated Show resolved Hide resolved
lxd/instances_post.go Outdated Show resolved Hide resolved
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.

Looks good, just some minor changes.

Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
`fmt.Sprintf` being much slower it should be kept for when it is really needed.
It's slowness comes from using reflection under the hood making it the slowest
of the `fmt.Sprint*` functions.

Signed-off-by: Simon Deziel <[email protected]>
LVM commands often use `100%FREE` or `100%ORIGIN` which can be interpreted as
format specifiers when passed to `fmt.Sprintf` for example.

Signed-off-by: Simon Deziel <[email protected]>
Avoid accessing slice out of bound if no `%d` is present in the pattern.
The snapshot pattern doesn't need `%d` to be escaped now that `Sprintf` isn't
used.

Signed-off-by: Simon Deziel <[email protected]>
Avoid accessing slice out of bound if no `%d` is present in the pattern.
The snapshot pattern doesn't need `%d` to be escaped now that `Sprintf` isn't
used.

Signed-off-by: Simon Deziel <[email protected]>
The validate.IsHostname() already rejects `/` so there is no need to explicitly
check for `/` in the instance name.

Signed-off-by: Simon Deziel <[email protected]>
This progress indicator was only shown in case of error.

Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>

lxd/instances_post: prefer strconv.Itoa to Sprintf

Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
This slice is only `append()`'ed to.

Signed-off-by: Simon Deziel <[email protected]>
@tomponline tomponline merged commit 0116fcc into canonical:main Jan 9, 2025
28 checks passed
@simondeziel simondeziel deleted the misc branch January 9, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants