Skip to content

Commit b8814d0

Browse files
committed
Remove NamespaceSourceQuerier API that is no longer in use
NamespaceSourceQuerier API is no longer in use for new resolver so it should be removed to reduce tech debt and usable code. Signed-off-by: Vu Dinh <[email protected]>
1 parent 81e7a60 commit b8814d0

File tree

3 files changed

+2
-240
lines changed

3 files changed

+2
-240
lines changed

Diff for: pkg/controller/operators/catalog/operator.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,6 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
891891
// get the set of sources that should be used for resolution and best-effort get their connections working
892892
logger.Debug("resolving sources")
893893

894-
querier := NewNamespaceSourceQuerier(o.sources.AsClients(o.namespace, namespace))
895-
896894
logger.Debug("checking if subscriptions need update")
897895

898896
subs, err := o.listSubscriptions(namespace)
@@ -925,7 +923,7 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
925923
subscriptionUpdated = subscriptionUpdated || changedIP
926924

927925
// record the current state of the desired corresponding CSV in the status. no-op if we don't know the csv yet.
928-
sub, changedCSV, err := o.ensureSubscriptionCSVState(logger, sub, querier)
926+
sub, changedCSV, err := o.ensureSubscriptionCSVState(logger, sub)
929927
if err != nil {
930928
logger.Debugf("error recording current state of CSV in status: %v", err)
931929
return err
@@ -1092,7 +1090,7 @@ func (o *Operator) ensureSubscriptionInstallPlanState(logger *logrus.Entry, sub
10921090
return updated, true, nil
10931091
}
10941092

1095-
func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha1.Subscription, querier SourceQuerier) (*v1alpha1.Subscription, bool, error) {
1093+
func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha1.Subscription) (*v1alpha1.Subscription, bool, error) {
10961094
if sub.Status.CurrentCSV == "" {
10971095
return sub, false, nil
10981096
}
@@ -1103,10 +1101,6 @@ func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha
11031101
logger.WithError(err).WithField("currentCSV", sub.Status.CurrentCSV).Debug("error fetching csv listed in subscription status")
11041102
out.Status.State = v1alpha1.SubscriptionStateUpgradePending
11051103
} else {
1106-
// Check if an update is available for the current csv
1107-
if err := querier.Queryable(); err != nil {
1108-
return nil, false, err
1109-
}
11101104
out.Status.State = v1alpha1.SubscriptionStateAtLatest
11111105
out.Status.InstalledCSV = sub.Status.CurrentCSV
11121106
}

Diff for: pkg/controller/operators/catalog/querier.go

-125
This file was deleted.

Diff for: pkg/controller/operators/catalog/querier_test.go

-107
This file was deleted.

0 commit comments

Comments
 (0)