Skip to content

Commit 452e56e

Browse files
committed
Check for condition status and reason
This adds checks ensuring that for offline clusters, for which calls to update bundle deployment statuses are expected, those statuses contain `Ready` and `Monitored` conditions with status `False` and reasons reflecting the cluster's offline status.
1 parent 86f8d9a commit 452e56e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/cmd/controller/clustermonitor/monitor_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ func (m BDStatusMatcher) Matches(x interface{}) bool {
4242
if cond.Type == "Ready" {
4343
foundReady = true
4444

45-
if !strings.Contains(cond.Message, "offline") {
45+
if cond.Status != "False" ||
46+
!strings.Contains(cond.Reason, "offline") ||
47+
!strings.Contains(cond.Message, "offline") {
4648
return false
4749
}
4850
} else if cond.Type == "Monitored" {
4951
foundMonitored = true
5052

51-
if !strings.Contains(cond.Message, "offline") {
53+
if cond.Status != "False" ||
54+
!strings.Contains(cond.Reason, "offline") ||
55+
!strings.Contains(cond.Message, "offline") {
5256
return false
5357
}
5458
}

0 commit comments

Comments
 (0)