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

Prune API of the resolver package. #2330

Conversation

benluddy
Copy link
Contributor

The resolver package exports a number of identifiers that have not been used for resolution in over a year. As part of the ongoing effort to decouple purely-resolution-related concerns from the rest of OLM, some of these have been rehomed into the packages that still consume them, and entirely unused code has been removed.

It's a test stub that has only one consumer. Generating a fake into
pkg/fakes with counterfeiter and using it for tests in
pkg/controller/operators/olm introduces a number of transitive package
dependencies that make it difficult to unwind the resolver package
from other runtime components.

Signed-off-by: Ben Luddy <[email protected]>
It has been living in the resolver package as a holdover from earlier
generations of resolution, but is only consumed by olm-operator as
part of OperatorGroup reconciliation.

Signed-off-by: Ben Luddy <[email protected]>
The only user of the provided/required API labeling functionality is
olm-operator, but it was still residing in the resolver package.

Signed-off-by: Ben Luddy <[email protected]>
This interface is used only by olm-operator and doesn't provide a
useful abstraction on top of directly reading fields from Operator
structs.

Signed-off-by: Ben Luddy <[email protected]>
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2021
SourceQuerier is a holdover from the previous resolution
implementation. Now, it only gets minor usage in
catalog-operator. Unused methods have been removed, and SourceQuerier
has moved to pkg/controller/operators/catalog beside where it is used.

Signed-off-by: Ben Luddy <[email protected]>
@benluddy benluddy force-pushed the shrink-resolver-surface branch from b4dc6df to 5ef4dab Compare August 18, 2021 17:04
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

Looking good. Just a tiny nit.
I can lgtm if it is good to go. Certainly don't want to hold this on a tiny nit.

Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

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

At times like this I'm glad we haven't bumped the module to v1 yet :)

/lgtm

@@ -890,7 +890,7 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
// get the set of sources that should be used for resolution and best-effort get their connections working
logger.Debug("resolving sources")

querier := resolver.NewNamespaceSourceQuerier(o.sources.AsClients(o.namespace, namespace))
Copy link
Member

Choose a reason for hiding this comment

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

TIL: this wasn't (never?) actually dependency injected

even if it was, the DI should have taken a factory anyway

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2021
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Aug 18, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benluddy, dinhxuanvu, njhale

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-merge-robot openshift-merge-robot merged commit 9b537bf into operator-framework:master Aug 18, 2021
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.

4 participants