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

product_version regex matching for the version is too relaxed #130

Open
xinzweb opened this issue May 27, 2020 · 1 comment
Open

product_version regex matching for the version is too relaxed #130

xinzweb opened this issue May 27, 2020 · 1 comment

Comments

@xinzweb
Copy link

xinzweb commented May 27, 2020

When we add 5\..*, not only 5.0.0 will be matched, but also anything with 5. in it will be matched, e.g. 6.5.0 will also be matched. This caused some unexpected behavior when we are using it.

We saw the reference at https://github.com/pivotal-cf/pivnet-resource/blob/master/filter/filter.go#L40, where regexp.MatchString(version, release.Version) will be able to match the string in any position.

Maybe update the product_version description to highlight the usage, e.g. adding anchor ^5\..* in order to match any 5.* releases. Or, make the regexp.MatchString more strict to always add a ^ anchor automatically in front the version.

@khng
Copy link

khng commented May 29, 2020

Thanks for the feedback!

Does this section in the documentation capture what you are describing? If so, we can update the product_version description, like you suggested, with a link to that as well to clarify to users more explicitly.

What are your thoughts on this?

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

No branches or pull requests

2 participants