Remove issue reference and trim the comment down to the assertion's
intent, per @roidelapluie review.
Signed-off-by: alliasgher <alliasgher123@gmail.com>
Rather than widening the assertion to accept raw hex codes, skip the
strict _MAGIC format check with t.Skipf when the filesystem is not in
the known map. The test still exercises the error paths and will run
fully on standard Linux/macOS filesystems.
Fixesprometheus/prometheus#18471
Signed-off-by: Ali <ali@kscope.ai>
FsType() returns the known magic-name string when the filesystem is
present in its internal map, and falls back to strconv.FormatInt(..., 16)
otherwise. The test was asserting the *MAGIC regex only, so it failed
whenever it happened to run on a filesystem not yet mapped — the
downstream Arch Linux packager hit this with a btrfs subvolume.
Extend the regex to accept either a magic-name or the numeric
lowercase-hex fallback, keeping the test stable across OS upgrades and
exotic filesystems.
Fixes#18471
Signed-off-by: Ali <alliasgher123@gmail.com>
Taken from `/usr/include/linux/magic.h` with linux-api-headers v6.19.
Includes newer popular filesystems like btrfs.
Also see #18471.
Signed-off-by: Justin Kromlinger <hashworks@archlinux.org>
On some GOOS (e.g. dragonfly), statfs.Blocks is int64, which can
cause a type mismatch when multiplied with Bsize. Cast both operands to
uint64 explicitly.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
This reverts the removal of type casting due to an error in the
dragonfly integration. The change in the type casting introduced by the
commit causes a type mismatch, resulting in the following errors:
util/runtime/limits_default.go:42:57: cannot use rlimit.Cur (variable of type int64) as type uint64 in argument to limitToString
util/runtime/limits_default.go:42:90: cannot use rlimit.Max (variable of type int64) as type uint64 in argument to limitToString
Reverting this commit to resolve the type mismatch error and maintain compatibility with the dragonfly integration.
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
* Run gofumpt on all files
Getting golangci-lint errors when building on my laptop, possibly because I have newer version of gofumpt then what it was formatted with.
Run gofumpt -w -extra on all files as it will be needed in the future anyway.
* Update golangci-lint to v1.44.2
v1.44.0 upgraded gofumpt so bumping version in CI will help keep formatting correct for everyone
* Address golangci-lint error
Getting 'error-strings: error strings should not be capitalized or end with punctuation or a newline' from revive here.
Drop new line.
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
This creates a new `model` directory and moves all data-model related
packages over there:
exemplar labels relabel rulefmt textparse timestamp value
All the others are more or less utilities and have been moved to `util`:
gate logging modetimevfs pool runtime
Signed-off-by: beorn7 <beorn@grafana.com>