@@ -19,6 +19,7 @@ import (
19
19
"k8s.io/apimachinery/pkg/api/equality"
20
20
k8serrors "k8s.io/apimachinery/pkg/api/errors"
21
21
"k8s.io/apimachinery/pkg/api/meta"
22
+ "k8s.io/apimachinery/pkg/fields"
22
23
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23
24
k8slabels "k8s.io/apimachinery/pkg/labels"
24
25
"k8s.io/apimachinery/pkg/runtime"
@@ -4247,6 +4248,20 @@ var _ = Describe("Disabling copied CSVs", func() {
4247
4248
return nil
4248
4249
}).Should (Succeed ())
4249
4250
TeardownNamespace (ns .GetName ())
4251
+ Eventually (func () bool {
4252
+ var namespaces corev1.NamespaceList
4253
+ err := ctx .Ctx ().Client ().List (context .Background (), & namespaces , & client.ListOptions {})
4254
+ if err != nil || len (namespaces .Items ) == 0 {
4255
+ return false
4256
+ }
4257
+ for _ , n := range namespaces .Items {
4258
+ if ns .GetName () == n .GetName () {
4259
+ return false
4260
+ }
4261
+ }
4262
+
4263
+ return true
4264
+ }).Should (BeTrue ())
4250
4265
})
4251
4266
4252
4267
When ("an operator is installed in AllNamespace mode" , func () {
@@ -4403,7 +4418,7 @@ var _ = Describe("Disabling copied CSVs", func() {
4403
4418
}
4404
4419
4405
4420
var namespaces corev1.NamespaceList
4406
- if err := ctx .Ctx ().Client ().List (context .TODO (), & namespaces , & client.ListOptions {}); err != nil {
4421
+ if err := ctx .Ctx ().Client ().List (context .TODO (), & namespaces , & client.ListOptions {FieldSelector : fields . SelectorFromSet ( map [ string ] string { "status.phase" : "Active" }) }); err != nil {
4407
4422
return err
4408
4423
}
4409
4424
0 commit comments