Skip to content

Commit 09f1046

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 ab923b3 commit 09f1046

File tree

3 files changed

+2
-240
lines changed

3 files changed

+2
-240
lines changed

pkg/controller/operators/catalog/operator.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,6 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
887887
// get the set of sources that should be used for resolution and best-effort get their connections working
888888
logger.Debug("resolving sources")
889889

890-
querier := NewNamespaceSourceQuerier(o.sources.AsClients(o.namespace, namespace))
891-
892890
logger.Debug("checking if subscriptions need update")
893891

894892
subs, err := o.listSubscriptions(namespace)
@@ -921,7 +919,7 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
921919
subscriptionUpdated = subscriptionUpdated || changedIP
922920

923921
// record the current state of the desired corresponding CSV in the status. no-op if we don't know the csv yet.
924-
sub, changedCSV, err := o.ensureSubscriptionCSVState(logger, sub, querier)
922+
sub, changedCSV, err := o.ensureSubscriptionCSVState(logger, sub)
925923
if err != nil {
926924
logger.Debugf("error recording current state of CSV in status: %v", err)
927925
return err
@@ -1105,7 +1103,7 @@ func (o *Operator) ensureSubscriptionInstallPlanState(logger *logrus.Entry, sub
11051103
return out, true, nil
11061104
}
11071105

1108-
func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha1.Subscription, querier SourceQuerier) (*v1alpha1.Subscription, bool, error) {
1106+
func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha1.Subscription) (*v1alpha1.Subscription, bool, error) {
11091107
if sub.Status.CurrentCSV == "" {
11101108
return sub, false, nil
11111109
}
@@ -1116,10 +1114,6 @@ func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha
11161114
logger.WithError(err).WithField("currentCSV", sub.Status.CurrentCSV).Debug("error fetching csv listed in subscription status")
11171115
out.Status.State = v1alpha1.SubscriptionStateUpgradePending
11181116
} else {
1119-
// Check if an update is available for the current csv
1120-
if err := querier.Queryable(); err != nil {
1121-
return nil, false, err
1122-
}
11231117
out.Status.State = v1alpha1.SubscriptionStateAtLatest
11241118
out.Status.InstalledCSV = sub.Status.CurrentCSV
11251119
}

pkg/controller/operators/catalog/querier.go

Lines changed: 0 additions & 125 deletions
This file was deleted.

pkg/controller/operators/catalog/querier_test.go

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)