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

Version in CSV name should match the version field #237

Open
gallettilance opened this issue Apr 13, 2022 · 3 comments
Open

Version in CSV name should match the version field #237

gallettilance opened this issue Apr 13, 2022 · 3 comments

Comments

@gallettilance
Copy link
Member

validation that exists today in the operatorhub test suite only checks that the csv name is "name + a version" not "name + the version field"

func checkBundleName(checks CSVChecks) CSVChecks {

This means teams can release myoperator.v.1.0.0 with version: 1.0.1 which should not pass validation.

@kevinrizza
Copy link
Member

I'm not sure it makes sense to do this for the entire version string. All kubernetes resource names have a set of character and length restrictions that make them incompatible with semver strings. See:

https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

Compare that to the semver spec, for example build metadata which includes + characters: https://semver.org/#spec-item-10 and there's already an obvious incompatibility.

In general, the convention operators have been following has been:

$operatorname.v.$majorversion.$minorversion.$patchversion

I think it could make sense to parse the csv metadata.name and pull the major minor and patch versions, and ensure that those match, but this is still mostly for the purpose of UX and information, so I don't think we should restrict the spec.version of csvs from the current allowable values -- today that looks like anything that conforms to the semver spec.

@camilamacedo86
Copy link
Contributor

camilamacedo86 commented Apr 14, 2022

It shows for me that what we can do here is check if the v.$majorversion.$minorversion.$patchversion when present matches with the CSV.spec version and provides warnings when not. That would fit well in the Good Practices Validator when we check if the Operator Bundle name follows the convention $operatorname.v.$majorversion.$minorversion.$patchversion.

Note that the PR: #238 shows block this one.

@camilamacedo86
Copy link
Contributor

@ryantking wdyt? Could you give us a hand with this one?
c/c @gallettilance

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

3 participants