Skip to content

Commit 0482515

Browse files
committed
Simplify pod number checking conditions
1 parent 33e9d83 commit 0482515

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/framework/prometheus.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,8 @@ func InstallPrometheus(
8383
return PrometheusInstance{}, fmt.Errorf("failed to get Prometheus pods: %w", err)
8484
}
8585

86-
if len(pods) == 0 {
87-
return PrometheusInstance{}, errors.New("no Prometheus pods found")
88-
}
89-
90-
if len(pods) > 1 {
91-
return PrometheusInstance{}, errors.New("multiple Prometheus pods found, expected one")
86+
if len(pods) != 1 {
87+
return PrometheusInstance{}, fmt.Errorf("expected one Prometheus pod, found %d", len(pods))
9288
}
9389

9490
pod := pods[0]

0 commit comments

Comments
 (0)