Skip to content

Commit 4d25c5a

Browse files
committed
add test in pkg/health/health_test.go
Signed-off-by: Arnaud Farbos <[email protected]>
1 parent e460207 commit 4d25c5a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/health/health_hpa.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func checkConditions(conditions []hpaCondition, progressingStatus *HealthStatus)
147147
}
148148
}
149149

150-
if len(conditions) == len(healthyMessages) {
150+
if len(healthyMessages) > 0 {
151151
return &HealthStatus{Status: HealthStatusHealthy, Message: strings.Join(healthyMessages, ",")}, nil
152152
}
153153

pkg/health/health_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func TestJob(t *testing.T) {
8181
func TestHPA(t *testing.T) {
8282
assertAppHealth(t, "./testdata/hpa-v2-healthy.yaml", HealthStatusHealthy)
8383
assertAppHealth(t, "./testdata/hpa-v2-degraded.yaml", HealthStatusDegraded)
84+
assertAppHealth(t, "./testdata/hpa-v2-degraded-partially.yaml", HealthStatusDegraded)
8485
assertAppHealth(t, "./testdata/hpa-v2-progressing.yaml", HealthStatusProgressing)
8586
assertAppHealth(t, "./testdata/hpa-v2beta2-healthy.yaml", HealthStatusHealthy)
8687
assertAppHealth(t, "./testdata/hpa-v2beta1-healthy-disabled.yaml", HealthStatusHealthy)

0 commit comments

Comments
 (0)