Skip to content

Commit

Permalink
add test in pkg/health/health_test.go
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaud Farbos <[email protected]>
  • Loading branch information
afarbos committed Sep 5, 2024
1 parent e460207 commit 4d25c5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/health/health_hpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func checkConditions(conditions []hpaCondition, progressingStatus *HealthStatus)
}
}

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

Expand Down
1 change: 1 addition & 0 deletions pkg/health/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func TestJob(t *testing.T) {
func TestHPA(t *testing.T) {
assertAppHealth(t, "./testdata/hpa-v2-healthy.yaml", HealthStatusHealthy)
assertAppHealth(t, "./testdata/hpa-v2-degraded.yaml", HealthStatusDegraded)
assertAppHealth(t, "./testdata/hpa-v2-degraded-partially.yaml", HealthStatusDegraded)
assertAppHealth(t, "./testdata/hpa-v2-progressing.yaml", HealthStatusProgressing)
assertAppHealth(t, "./testdata/hpa-v2beta2-healthy.yaml", HealthStatusHealthy)
assertAppHealth(t, "./testdata/hpa-v2beta1-healthy-disabled.yaml", HealthStatusHealthy)
Expand Down

0 comments on commit 4d25c5a

Please sign in to comment.