Fix Diagnose Formatting In Disk Usage Checks#12229
Merged
Conversation
ncabatoff
reviewed
Aug 2, 2021
vault/diagnose/os_common.go
Outdated
| if usage.UsedPercent > 95 { | ||
| SpotWarn(ctx, testName, fmt.Sprintf(partition.Mountpoint+" is %d percent full.", usage.UsedPercent), | ||
| Advice("It is recommended to have more than five percent of the partition free.")) | ||
| SpotWarn(ctx, testName, fmt.Sprintf(partition.Mountpoint+" is %f percent full.", usage.UsedPercent)) |
Collaborator
There was a problem hiding this comment.
I usually like to limit the number of digits of precision for float printfs, e.g. %.2f. Otherwise it can look ungainly.
Contributor
Author
There was a problem hiding this comment.
Ah, didn't realize there was a simple way to make that nicer. Thanks, will do!
ncabatoff
reviewed
Aug 2, 2021
vault/diagnose/os_common.go
Outdated
| } else if usage.Free < 2<<30 { | ||
| SpotWarn(ctx, testName, partition.Mountpoint+" has %d bytes full.", | ||
| Advice("It is recommended to have at least 1 GB of space free per partition.")) | ||
| SpotWarn(ctx, testName, fmt.Sprintf(partition.Mountpoint+" has %d bytes free.", usage.Free)) |
Collaborator
There was a problem hiding this comment.
Bytes can be hard to read when we're talking about 8-9 digits. Maybe show as MBs or MiBs instead?
ncabatoff
approved these changes
Aug 2, 2021
tsaarni
pushed a commit
to Nordix/vault
that referenced
this pull request
Mar 5, 2026
…hicorp#12212) (hashicorp#12229) (hashicorp#12230) * PKI: Invalidate CMPv2 cached configuration of perf standby nodes * add cl Co-authored-by: Steven Clark <steven.clark@hashicorp.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.