@@ -96,6 +96,7 @@ func NewOperator(kubeconfigPath string, logger *logrus.Logger, wakeupInterval ti
96
96
// resolver needs subscription and csv listers
97
97
lister .OperatorsV1alpha1 ().RegisterSubscriptionLister (namespace , nsInformerFactory .Operators ().V1alpha1 ().Subscriptions ().Lister ())
98
98
lister .OperatorsV1alpha1 ().RegisterClusterServiceVersionLister (namespace , nsInformerFactory .Operators ().V1alpha1 ().ClusterServiceVersions ().Lister ())
99
+ lister .OperatorsV1alpha1 ().RegisterInstallPlanLister (namespace , nsInformerFactory .Operators ().V1alpha1 ().InstallPlans ().Lister ())
99
100
}
100
101
101
102
// Create a new queueinformer-based operator.
@@ -672,7 +673,7 @@ func (o *Operator) ensureSubscriptionInstallPlanState(logger *logrus.Entry, sub
672
673
673
674
// check if there's an installplan that created this subscription (only if it doesn't have a reference yet)
674
675
// this indicates it was newly resolved by another operator, and we should reference that installplan in the status
675
- ips , err := o .client .OperatorsV1alpha1 ().InstallPlans (sub .GetNamespace ()).List (metav1. ListOptions {} )
676
+ ips , err := o .lister .OperatorsV1alpha1 ().InstallPlanLister (). InstallPlans (sub .GetNamespace ()).List (labels . Everything () )
676
677
if err != nil {
677
678
logger .WithError (err ).Debug ("couldn't get installplans" )
678
679
// if we can't list, just continue processing
@@ -681,12 +682,12 @@ func (o *Operator) ensureSubscriptionInstallPlanState(logger *logrus.Entry, sub
681
682
682
683
out := sub .DeepCopy ()
683
684
684
- for _ , ip := range ips . Items {
685
+ for _ , ip := range ips {
685
686
for _ , step := range ip .Status .Plan {
686
687
// TODO: is this enough? should we check equality of pkg/channel?
687
688
if step != nil && step .Resource .Kind == v1alpha1 .SubscriptionKind && step .Resource .Name == sub .GetName () {
688
689
logger .WithField ("installplan" , ip .GetName ()).Debug ("found subscription in steps of existing installplan" )
689
- out .Status .Install = o .referenceForInstallPlan (& ip )
690
+ out .Status .Install = o .referenceForInstallPlan (ip )
690
691
out .Status .State = v1alpha1 .SubscriptionStateUpgradePending
691
692
if updated , err := o .client .OperatorsV1alpha1 ().Subscriptions (sub .GetNamespace ()).UpdateStatus (out ); err != nil {
692
693
return nil , err
0 commit comments