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

CSV Validation should check spec.version and metadata.annotations.skipRange #226

Open
joelanford opened this issue Feb 18, 2022 · 2 comments

Comments

@joelanford
Copy link
Member

joelanford commented Feb 18, 2022

OLM requires the ClusterServiceVersion's spec.version field to be valid semver (parsable with blang/semver.Parse()). For example,

In opm:

In OLM:

See operator-framework/operator-registry#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.

@camilamacedo86
Copy link
Contributor

camilamacedo86 commented Feb 21, 2022

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.

@camilamacedo86
Copy link
Contributor

c/c @ryantking

@joelanford joelanford changed the title CSV Validation should check spec.version CSV Validation should check spec.version and metadata.annotations.skipRange Mar 8, 2022
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