Skip to content

Commit 6a7d3ae

Browse files
committed
e2e: Filter out terminating namespaces when calculating AllNamespace copied CSVs
Signed-off-by: timflannagan <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: d02ab0e4270a7011ad4db740995bc4dde62b3323
1 parent bd43e48 commit 6a7d3ae

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

staging/operator-lifecycle-manager/test/e2e/csv_e2e_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4417,10 +4417,17 @@ var _ = Describe("Disabling copied CSVs", func() {
44174417
return err
44184418
}
44194419

4420-
if len(namespaces.Items)-1 != len(copiedCSVs.Items) {
4421-
return fmt.Errorf("%d copied CSVs found, expected %d", len(copiedCSVs.Items), len(namespaces.Items)-1)
4420+
targetNamespaces := len(namespaces.Items) - 1
4421+
for _, ns := range namespaces.Items {
4422+
// filter out any namespaces that are currently reporting a Terminating phase
4423+
// as the API server will reject any resource events in terminating namespaces.
4424+
if ns.Status.Phase == "Terminating" {
4425+
targetNamespaces--
4426+
}
4427+
}
4428+
if targetNamespaces != len(copiedCSVs.Items) {
4429+
return fmt.Errorf("%d copied CSVs found, expected %d", len(copiedCSVs.Items), targetNamespaces)
44224430
}
4423-
44244431
return nil
44254432
}).Should(Succeed())
44264433
})

0 commit comments

Comments
 (0)