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

Fix min kube version validation #286

Conversation

kutluhanmetin
Copy link
Contributor

@kutluhanmetin kutluhanmetin commented Jul 14, 2023

Fixes operator-framework/operator-sdk#5995
operator-sdk bundle validate passes all tests when CSV's spec.minKubeVersion with version format x.y. However spec.minKubeVersion with format x.y should be invalid because OLM refuses to deploy the CSV. Basically, this PR adds a validation method validateMinKubeVersion that validates if version format is in semantic versioning x.y.z. So that operator-sdk bundle validate fails before OLM refuses to deploy.

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kutluhanmetin Thanks for this contribution! These changes look good to me.

Would you mind updating the PR description to include a summary of the changes and the motivation for the changes? I'm aware of the context for this PR but other reviewers may not be so it would help them get up to speed before conducting their review :)

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #286 (467656f) into master (bbac502) will increase coverage by 0.20%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #286      +/-   ##
==========================================
+ Coverage   41.74%   41.94%   +0.20%     
==========================================
  Files          39       39              
  Lines        3481     3488       +7     
==========================================
+ Hits         1453     1463      +10     
+ Misses       1881     1879       -2     
+ Partials      147      146       -1     
Files Changed Coverage Δ
pkg/validation/internal/csv.go 68.21% <100.00%> (+4.28%) ⬆️
pkg/validation/internal/operatorhub.go 78.07% <100.00%> (ø)

@kutluhanmetin
Copy link
Contributor Author

@kutluhanmetin Thanks for this contribution! These changes look good to me.

Would you mind updating the PR description to include a summary of the changes and the motivation for the changes? I'm aware of the context for this PR but other reviewers may not be so it would help them get up to speed before conducting their review :)

Added the description 👍

Copy link
Member

@rashmigottipati rashmigottipati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @kutluhanmetin, changes look good to me.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2023
@oceanc80
Copy link

/approve

1 similar comment
@kevinrizza
Copy link
Member

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jul 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kevinrizza, kutluhanmetin, oceanc80

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 25, 2023
@openshift-merge-robot openshift-merge-robot merged commit fdfcb35 into operator-framework:master Jul 25, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bundle validate does not fail on invalid minKubeVersion
6 participants