@@ -19,7 +19,6 @@ import (
19
19
extinf "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions"
20
20
k8serrors "k8s.io/apimachinery/pkg/api/errors"
21
21
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22
- "k8s.io/apimachinery/pkg/labels"
23
22
"k8s.io/apimachinery/pkg/runtime/schema"
24
23
utilclock "k8s.io/apimachinery/pkg/util/clock"
25
24
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@@ -915,7 +914,7 @@ func (o *Operator) ensureInstallPlan(logger *logrus.Entry, namespace string, sub
915
914
}
916
915
917
916
// Check if any existing installplans are creating the same resources
918
- installPlans , err := o .lister . OperatorsV1alpha1 (). InstallPlanLister (). InstallPlans ( namespace ). List ( labels . Everything () )
917
+ installPlans , err := o .listInstallPlans ( namespace )
919
918
if err != nil {
920
919
return nil , err
921
920
}
@@ -1563,6 +1562,20 @@ func (o *Operator) listSubscriptions(namespace string) (subs []*v1alpha1.Subscri
1563
1562
return
1564
1563
}
1565
1564
1565
+ func (o * Operator ) listInstallPlans (namespace string ) (ips []* v1alpha1.InstallPlan , err error ) {
1566
+ list , err := o .client .OperatorsV1alpha1 ().InstallPlans (namespace ).List (metav1.ListOptions {})
1567
+ if err != nil {
1568
+ return
1569
+ }
1570
+
1571
+ ips = make ([]* v1alpha1.InstallPlan , 0 )
1572
+ for i := range list .Items {
1573
+ ips = append (ips , & list .Items [i ])
1574
+ }
1575
+
1576
+ return
1577
+ }
1578
+
1566
1579
// competingCRDOwnersExist returns true if there exists a CSV that owns at least one of the given CSVs owned CRDs (that's not the given CSV)
1567
1580
func competingCRDOwnersExist (namespace string , csv * v1alpha1.ClusterServiceVersion , existingOwners map [string ][]string ) (bool , error ) {
1568
1581
// Attempt to find a pre-existing owner in the namespace for any owned crd
0 commit comments