Skip to content

Commit 82f9151

Browse files
committed
fix(installplan): only resolve if there's a subscription in the ns that
isn't up to date
1 parent 7b640d5 commit 82f9151

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pkg/controller/operators/catalog/operator.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,34 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
511511
return fmt.Errorf("casting Namespace failed")
512512
}
513513
namespace := ns.GetName()
514+
514515
logger := o.Log.WithFields(logrus.Fields{
515516
"namespace": namespace,
516517
})
518+
517519
// get the set of sources that should be used for resolution and best-effort get their connections working
518520
logger.Debug("resolving sources")
519521
resolverSources := o.ensureResolverSources(logger, namespace)
520522

523+
logger.Debug("checking if subscriptions need update")
524+
525+
subs, err := o.lister.OperatorsV1alpha1().SubscriptionLister().Subscriptions(namespace).List(labels.Everything())
526+
if err != nil {
527+
logger.WithError(err).Debug("couldn't list subscriptions")
528+
return err
529+
}
530+
531+
shouldUpdate := false
532+
for _, sub := range subs {
533+
if !o.nothingToUpdate(logger, sub) {
534+
shouldUpdate = true
535+
break
536+
}
537+
}
538+
if !shouldUpdate {
539+
logger.Debug("all subscriptions up to date")
540+
}
541+
521542
logger.Debug("resolving subscriptions in namespace")
522543

523544
// resolve a set of steps to apply to a cluster, a set of subscriptions to create/update, and any errors

0 commit comments

Comments
 (0)