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

Detect common invalid annotations: e.g. olm.skiprange #568

Closed
cdjohnson opened this issue Jan 21, 2021 · 3 comments · Fixed by #605
Closed

Detect common invalid annotations: e.g. olm.skiprange #568

cdjohnson opened this issue Jan 21, 2021 · 3 comments · Fixed by #605
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@cdjohnson
Copy link
Contributor

It's a very common problem to accidentally use the annotation olm.skiprange instead of olm.skipRange. It can take days or weeks for a new developer to not understand why their operators will never upgrade to a new channel.

It would be very helpful for new developers if opm <index|registry> add would simply detect some of the most common errors like this.

@cdjohnson
Copy link
Contributor Author

Discussed in the OLM Feature Planning meeting today a bit. They suggested that this be fixed in the API repo here:
https://github.com/operator-framework/api/tree/master/pkg/validation

@cdjohnson
Copy link
Contributor Author

Need to be careful that the validation doesn't happen in OLM and only in OPM.

Example: If someone already added a bad bundle to the catalog (it's been there for months in production), and then OLM now fails to install the catalog or bundle, that would be bad.

@jchunkins
Copy link
Contributor

@cdjohnson Regarding your warning comment:

Need to be careful that the validation doesn't happen in OLM and only in OPM

At the moment ClusterServiceVersionValidator is the validator that is responsible for checking CSV validity. If you do a search for this across all repos in the operator-framework organization like this:

https://github.com/search?q=org%3Aoperator-framework+ClusterServiceVersionValidator&type=code

You will see that the only projects that use this are:

  • operator-framework/operator-sdk
  • operator-framework/operator-registry

Given the scope of your concern, we can ignore operator-framework/operator-sdk, leaving only usage within operator-framework/operator-registry.

From within the operator-framework/operator-registry the ClusterServiceVersionValidator is used in function ValidateBundleContent. This is a function that is part of the BundleImageValidator interface. You can see uses of this in this query:

https://github.com/search?q=org%3Aoperator-framework+ValidateBundleContent&type=code

It's used in calls such as:

  • opm alpha bundle unpack
  • opm alpha bundle validate

I don't see any initializer or registry-server usage of this validation logic, so I think we're OK with making changes in ClusterServiceVersionValidator as needed.

jchunkins added a commit to jchunkins/operator-registry that referenced this issue Mar 14, 2021
- update api project to v0.6.1 to pick up validator (and other) changes
- indirectly update k8s.io v0.20.1
- add e2e documentation
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Mar 27, 2021
- update api project to v0.6.1 to pick up validator (and other) changes
- indirectly update k8s.io v0.20.1
- add e2e documentation
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Mar 27, 2021
- update api project to v0.6.1 to pick up validator (and other) changes
- indirectly update k8s.io v0.20.1
- add e2e documentation
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
@joelanford joelanford added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 1, 2021
@joelanford joelanford added this to the 1.17.0 milestone Apr 1, 2021
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 3, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- add e2e documentation
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 5, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 6, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 6, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 6, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 8, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 8, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 13, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 14, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 15, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
jchunkins added a commit to jchunkins/operator-registry that referenced this issue Apr 15, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework#568

Signed-off-by: John Hunkins <[email protected]>
benluddy pushed a commit to benluddy/operator-framework-olm that referenced this issue Jul 1, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework/operator-registry#568

Signed-off-by: John Hunkins <[email protected]>

Upstream-repository: operator-registry
Upstream-commit: 128142ab441fbe501336bddde4954f0623ed1a98
openshift-merge-robot pushed a commit to openshift/operator-framework-olm that referenced this issue Jul 14, 2021
- update api project to v0.7.1 to pick up validator (and other) changes
- update code paths which support skip tls but did not expose it
- add test case and test data for annotation case sensitive validation
- update test case to handle multiple errors
- add .gitignore for artifacts generated from e2e tests
- use mkcerts for better crossplatform SSL cert generation
- create dedicated script for starting regsitry with & without SSL
- implement e2e ctx (i.e. context) package
- Provision impl for kind servers
- Provision impl for kubeconfig (i.e. all other server types)
- adjust makefile to account for `kind` build tag
- allow e2e target to use focus flag
- allow e2e target to use skip tls flag for local testing
- adjust test.yml git action workflow to use start_registry script
- adjust test.yml git action to remove kind (since its now dynamic)
- add e2e documentation for all scenarios
- use regex to determine possible kind control plane names
- add --name argument for kind load docker-image call
- update vendor

Implements operator-framework/operator-registry#568

Signed-off-by: John Hunkins <[email protected]>

Upstream-repository: operator-registry
Upstream-commit: 128142ab441fbe501336bddde4954f0623ed1a98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants