Skip to content

Remove hardcoded references to the registry gRPC API from the resolver packages. #2340

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

Conversation

benluddy
Copy link
Contributor

@benluddy benluddy commented Sep 3, 2021

The resolver component does not care whether a given cache entry was
populated by use of the registry gRPC API, so it should ultimately be
possible to drop the "Bundle" field from cache entries altogether. For
now, catalog-operator's "step resolver" still depends on a Bundle
proto field in order to unpack inline (as opposed to image-based)
packages.

NewOperatorForBundle and NewOperatorFromV1Alpha1CSV couple the
resolver cache package to the registry gRPC API and the
operators/v1alpha1 CSV API, respectively. They're effectively used
only by the resolver package, so they can be moved there and
unexported. The remaining calls to NewOperatorFromV1Alpha1CSV can be
extracted from core resolver logic into a Source implementation that
is responsible for the conversion from ClusterServiceVersion to
cache.Snapshot entry, and the remaining call to NewOperatorFromBundle
is used only by the Source implementation based on the registry gRPC
API.

The resolver component does not care whether a given cache entry was
populated by use of the registry gRPC API, so it should ultimately be
possible to drop the "Bundle" field from cache entries altogether. For
now, catalog-operator's "step resolver" still depends on a Bundle
proto field in order to unpack inline (as opposed to image-based)
packages.

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 Sep 3, 2021
NewOperatorForBundle and NewOperatorFromV1Alpha1CSV couple the
resolver cache package to the registry gRPC API and the
operators/v1alpha1 CSV API, respectively. They're effectively used
only by the resolver package, so they can be moved there and
unexported. The remaining calls to NewOperatorFromV1Alpha1CSV can be
extracted from core resolver logic into a Source implementation that
is responsible for the conversion from ClusterServiceVersion to
cache.Snapshot entry, and the remaining call to NewOperatorFromBundle
is used only by the Source implementation based on the registry gRPC
API.

Signed-off-by: Ben Luddy <[email protected]>
@benluddy benluddy force-pushed the resolver-stop-using-bundle-proto branch from 905f7be to 89db06d Compare September 3, 2021 21:16
@benluddy benluddy requested a review from dinhxuanvu September 3, 2021 21:16
@benluddy
Copy link
Contributor Author

benluddy commented Sep 3, 2021

#2091

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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 7, 2021
@openshift-ci
Copy link

openshift-ci bot commented Sep 7, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [benluddy,dinhxuanvu]

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 b849eb7 into operator-framework:master Sep 7, 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.

None yet

3 participants