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

malformed version #31

Closed
ianb-mp opened this issue Feb 13, 2024 · 3 comments · Fixed by #32
Closed

malformed version #31

ianb-mp opened this issue Feb 13, 2024 · 3 comments · Fixed by #32

Comments

@ianb-mp
Copy link
Contributor

ianb-mp commented Feb 13, 2024

I'm getting this driver info from ethtool: driver info: &{i40e 5.14.0-362.8.1.el9_3.x86_64} however sriov-network-metrics-exporter doesn't like that and throws error Malformed version: 5.14.0-362.8.1.el9_3.x86_64

I poked around a bit and I can see that the version regex is failing to match - doesn't like the underscores.

If I skip the version check, it seems to work fine otherwise i.e. I see metrics for that interface.

@zeeke
Copy link
Member

zeeke commented Feb 13, 2024

Hi @ianb-mp, I hit the same issue on an OpenShift cluster.

That kind of version (likely to come from a kernel in-tree driver) does not appear to be supported by `github.com/hashicorp/go-version, ' which expects a semantic version.

supported, err := version.NewVersion(d.Version)

@ianb-mp
Copy link
Contributor Author

ianb-mp commented Feb 13, 2024

oh, somehow I missed the fact that version is a 3rd party package! I see a PR to fix this upstream was sent in 2021: hashicorp/go-version#90 but not merged yet.

I think that expecting the kernel to return a version that is strictly semver is not a good assumption. Would you be open to bringing version package into your git repo (e.g. under ./pkg/go-version) and merging the fix to include underscores? (I'd be happy to send a PR)

@zeeke
Copy link
Member

zeeke commented Feb 14, 2024

I'd prefer to use the library as is and to clean up the version before passing it.
@Eoghan1232 , @SchSeba WDYT?

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 a pull request may close this issue.

2 participants