diff --git a/controllers/operatorpolicy_status.go b/controllers/operatorpolicy_status.go index 454a4e0a..07197931 100644 --- a/controllers/operatorpolicy_status.go +++ b/controllers/operatorpolicy_status.go @@ -586,8 +586,8 @@ func buildCSVCond(csv *operatorv1alpha1.ClusterServiceVersion) metav1.Condition var noCSVCond = metav1.Condition{ Type: csvConditionType, - Status: metav1.ConditionTrue, - Reason: "NoRelevantClusterServiceVersion", + Status: metav1.ConditionFalse, + Reason: "RelevantCSVFound", Message: "A relevant installed ClusterServiceVersion could not be found", } diff --git a/test/e2e/case38_install_operator_test.go b/test/e2e/case38_install_operator_test.go index e22eb15e..2f5ebdbd 100644 --- a/test/e2e/case38_install_operator_test.go +++ b/test/e2e/case38_install_operator_test.go @@ -718,6 +718,16 @@ var _ = Describe("Test installing an operator from OperatorPolicy", Ordered, fun "No existing operator Deployments", ) }) + + It("Should not have any compliant events", func() { + // This test is meant to find an incorrect compliant event that is emitted between some + // correct noncompliant events. + events := utils.GetMatchingEvents( + clientManaged, opPolTestNS, parentPolicyName, "", "^Compliant;", eventuallyTimeout, + ) + + Expect(events).To(BeEmpty()) + }) }) Describe("Test status reporting for CatalogSource", Ordered, func() { const (