CSV Validation should check `spec.version` and `metadata.annotations.skipRange`
OLM requires the ClusterServiceVersion's spec.version field to be valid semver (parsable with blang/semver.Parse()). For example,
In opm:
- to generate a semver-based package manifest in replaces mode
- to add a bundle with semver mode
- parsing the version in file-based catalog
olm.packageproperties.
In OLM:
- to apply skipRange filters in the VersionInRangePredicate
See https://github.com/operator-framework/operator-registry/issues/910
We should add a new validation in the CSV validator to ensure spec.version is set to a string that can be parsed with semver.Parse and metadata.annotations.skipRange is set to a string that can be parsed with semver.ParseRange.
Just to clarify here, speaking about it with @joelanford:
The case we need to fail on is when that version has a “v” prefix. ParseTolerant allows that, Parse doesn't.
Since it means that the CSV data is invalid shows that ideally this check ought to be in the CSV validator: https://github.com/operator-framework/api/blob/master/pkg/validation/internal/csv.go.
That means we need to add the new check and its tests.
c/c @ryantking