Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/e2e/condition_matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ func (m *ConditionMatcher) Matches(conditions []opv1.OperatorCondition) bool {
}

if m.MatchesType(&cond) && !m.MatchesStatus(&cond) {
return false
if !m.Any {
return false
}
}
}

Expand Down
14 changes: 14 additions & 0 deletions test/e2e/condition_matcher_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ func TestVerifyOperatorStatusCondition(t *testing.T) {
expectError: true,
errorContains: "context deadline exceeded",
},
{
name: "Any mode succeeds when matching condition appears after non-matching one",
expectedConditions: map[string]opv1.ConditionStatus{
"Degraded": opv1.ConditionTrue,
},
initialObjects: []runtime.Object{
newCertManagerObjectWithConditions(
opv1.OperatorCondition{Type: controllerPrefix + "-static-resources-Degraded", Status: opv1.ConditionFalse},
opv1.OperatorCondition{Type: controllerPrefix + "Degraded", Status: opv1.ConditionTrue},
),
},
matchAny: true,
expectError: false,
},
{
name: "A missing condition for Progressing",
expectedConditions: map[string]opv1.ConditionStatus{
Expand Down