Skip to content

Commit 9e4a778

Browse files
authored
Reduce resolver dependencies on operator-registry and operator-lifecycle-manager. (#2337)
* Remove resolver dependency on registry.CatalogKey. Signed-off-by: Ben Luddy <[email protected]> * Remove hard resolver dependency on the gRPC registry client. The most significant change is the introduction of a new Source interface, which represents a single source of cache entries. In the existing implementation, the cache was hardcoded to fetch content from the operator-registry gRPC API on misses. This was a barrier to off-cluster tools and other applications that should be able to perform resolution without running a registry server. A number of test fixtures were affected (for the better) because it's now possible to directly configure the real Cache implementation to retrieve test content without using of test doubles. Signed-off-by: Ben Luddy <[email protected]>
1 parent 03493b5 commit 9e4a778

15 files changed

+880
-998
lines changed

pkg/controller/operators/catalog/operator.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import (
5555
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/grpc"
5656
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/reconciler"
5757
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver"
58+
resolvercache "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver/cache"
5859
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver/solver"
5960
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/catalogsource"
6061
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/clients"
@@ -463,7 +464,7 @@ func (o *Operator) syncSourceState(state grpc.SourceState) {
463464

464465
switch state.State {
465466
case connectivity.Ready:
466-
o.resolver.Expire(state.Key)
467+
o.resolver.Expire(resolvercache.SourceKey(state.Key))
467468
if o.namespace == state.Key.Namespace {
468469
namespaces, err := index.CatalogSubscriberNamespaces(o.catalogSubscriberIndexer,
469470
state.Key.Name, state.Key.Namespace)

0 commit comments

Comments
 (0)