-
Notifications
You must be signed in to change notification settings - Fork 551
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
Prune API of the resolver package. #2330
Conversation
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]>
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]>
b4dc6df
to
5ef4dab
Compare
There was a problem hiding this 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.
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[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 |
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.