Skip to content

zfs: fix dataset name parsing - #3768

Draft
vigneshakaviki wants to merge 1 commit into
prometheus:masterfrom
vigneshakaviki:fix/zfs-dataset-prefix
Draft

zfs: fix dataset name parsing#3768
vigneshakaviki wants to merge 1 commit into
prometheus:masterfrom
vigneshakaviki:fix/zfs-dataset-prefix

Conversation

@vigneshakaviki

Copy link
Copy Markdown

Summary

  • Parse the ZFS objset dataset value after the kstat type column instead of searching the full line for the value.
  • Preserve repeated spaces inside valid dataset names.
  • Add regression coverage for a root dataset whose name also occurs in dataset_name.

This prevents root pool names such as data from being exported as dataset_name 7 data.

Testing

  • make in Linux Go 1.26 container
  • go test -race ./...
  • GOARCH=amd64 go test ./collector -run '^TestZpoolObjsetParsing' -count=1
  • GOARCH=386 go test -c ./collector
  • govulncheck ./...

Fixes #3761

@SuperQ, please review.

Signed-off-by: vigneshakaviki <kumarvignesh295@gmail.com>
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.

ZFS collector misparses dataset values that occur in the kstat field prefix

1 participant