-
Notifications
You must be signed in to change notification settings - Fork 253
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
[BUG] OPM version parsing is not backward-compatible #910
Comments
I think this is an unfortunate situation where we have not been careful to specify the required format and include regression tests. Some parts of OPM (e.g. to generate a semver-based package manifest in replaces mode and to add a bundle with semver mode) and OLM (e.g. the VersionInRangePredicate in OLM's resolver) already expect to be able to parse the bundle version with I suspect that if you used semver-related features with bundles that specify a version with a "v" prefix, you'd encounter errors or unexpected behavior. |
@joelanford thanks for your answer. We have maybe around ~20 faulty bundles so not the end of the world. We can close this then as backporting won't help in the larger OLM ecosystem. |
In newer versions of OPM, bundle version is parsed using
semver.Parse(...)
from https://pkg.go.dev/github.com/blang/semver/v4#Parse.This creates both a build error, but also an error when trying to list bundles from an older indexImage:
This error will be present when parsing either an indexImage metadata or the
csv.Version
bundle field.In other words, semver does not support a prefix "v" character. At Red Hat, we rely extensively on OPM's tooling and this change makes many of our indexImages/bundleImages incompatible to use with newer OPM versions. Was this change intentional?
I am not sure when this breaking change was introduced, but I believe by simply changing this line with
semver.ParseTolerant(...)
we would solve the issue: https://github.com/operator-framework/operator-registry/blob/master/alpha/declcfg/declcfg_to_model.go#L124The text was updated successfully, but these errors were encountered: