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

zfs: tidy up Linux-specific code #3013

Merged
merged 6 commits into from
Sep 30, 2024
Merged

Conversation

dswarbrick
Copy link
Contributor

Group all Linux-specific zfs collector code in the already-existing zfs_linux.go, and move arch-agnostic init() function out of arch-specific files.

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

LGTM

@SuperQ
Copy link
Member

SuperQ commented Jul 14, 2024

Looks like this needs a rebase

@dswarbrick
Copy link
Contributor Author

@SuperQ Rebased, PTAL.

@dswarbrick
Copy link
Contributor Author

Rebased, again, due to incoming log/slog migration. PTAL, A.

@dswarbrick
Copy link
Contributor Author

CircleCI test failures appear to have been transient due to them having a bad day, but I not able to retry the job.

Avoid Linux-specific code scattered in two places by moving it to the
already-existing zfs_linux.go.

Signed-off-by: Daniel Swarbrick <[email protected]>
Code does not modify zfsPoolStatesName slice, so make it an array.

Signed-off-by: Daniel Swarbrick <[email protected]>
Ensure identical factory function name across arch-specific files so
that the common init() function in zfs.go works.

Signed-off-by: Daniel Swarbrick <[email protected]>
Also add build-tags to ensure it is ignored on non-relevant archs.

Signed-off-by: Daniel Swarbrick <[email protected]>
Drop superfluous and overly pedantic typecasting for values that fit
within 32 bits or where type comparison is already hinted.

Signed-off-by: Daniel Swarbrick <[email protected]>
@discordianfish discordianfish merged commit ebf3cbf into prometheus:master Sep 30, 2024
7 checks passed
@discordianfish
Copy link
Member

Thanks!

@dswarbrick dswarbrick deleted the zfs branch October 1, 2024 05:06
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