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

resolver: Add support for excluding global catalogs from resolution #2788

Merged
merged 1 commit into from Jun 16, 2022

Conversation

exdx
Copy link
Member

@exdx exdx commented May 31, 2022

The resolver is currently configured to always consider resolving
from global catalogs. In some cases, this may not be
desirable, and the user would like to explicitly ignore global catalogs
for the purposes of resolution. This change enables per-namespace
exclusion from global catalog sources via an annotation on the
operatorgroup.

The operatorgroup annotation key is olm.operatorframework.io/exclude-global-namespace-resolution
and setting the value to "true" will cause resolution to exclude global catalogs in that namespace.

Signed-off-by: Daniel Sover dsover@redhat.com

Description of the change:

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky
  • Tests that remove the [FLAKE] tag are no longer flaky

@exdx exdx requested review from perdasilva and benluddy May 31, 2022 20:47
@openshift-ci
Copy link

openshift-ci bot commented May 31, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 31, 2022
@openshift-ci openshift-ci bot requested a review from gallettilance May 31, 2022 20:47
@exdx exdx force-pushed the exclude-global-ns branch 2 times, most recently from c995b5e to abfdd0f Compare June 10, 2022 19:09
@exdx exdx marked this pull request as ready for review June 10, 2022 20:48
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 10, 2022
@openshift-ci openshift-ci bot requested review from anik120 and ecordell June 10, 2022 20:48
@exdx
Copy link
Member Author

exdx commented Jun 15, 2022

I squashed everything down to one commit (made Per the co-author on it as well).

The e2e test needs #2801 to go in first (that was originally part of this branch, but was broken out separately since its unrelated), then this can be rebased again, and it should be good after that.

Copy link
Contributor

@benluddy benluddy left a comment

Choose a reason for hiding this comment

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

Do you want to make the error text in cache.go unspecific to catalogs? Maybe something like "failed to populate resolver cache from source %v: %w"?

pkg/controller/operators/catalog/og_source_provider.go Outdated Show resolved Hide resolved
@exdx
Copy link
Member Author

exdx commented Jun 16, 2022

Do you want to make the error text in cache.go unspecific to catalogs? Maybe something like "failed to populate resolver cache from source %v: %w"?

That sounds good -- should make the error message more clear

@perdasilva
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jun 16, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: exdx, perdasilva

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 Jun 16, 2022
The resolver is currently configured to always consider resolving from global
catalogs. In some cases, this may not be desirable, and the user would like to
explicitly ignore global catalogs for the purposes of resolution. This change
enables per-namespace exclusion from global catalog sources via an annotation on
existing registry source provider.

A queueinformer for OperatorGroups is added since they are now an input to
resolution via the global catalog exclusion annotation. Namespace resolution
will be triggered on changes to an OperatorGroup, in case the value provided on
that annotation by the user changes.

Updated the error message returned by the cache in case a source has an error
to be more clear.

Signed-off-by: Daniel Sover <dsover@redhat.com>
Co-authored-by: perdasilva <perdasilva@redhat.com>
@benluddy
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 16, 2022
@openshift-ci openshift-ci bot merged commit dba08eb into operator-framework:master Jun 16, 2022
@cblecker cblecker mentioned this pull request Dec 4, 2022
11 tasks
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.

None yet

3 participants