Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Child apps should not affect parent app's health by default (#3781) #4448

Closed
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
5 changes: 3 additions & 2 deletions util/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ func ignoreLiveObjectHealth(liveObj *unstructured.Unstructured, resHealth appv1.
return true
}
gvk := liveObj.GroupVersionKind()
if gvk.Group == "argoproj.io" && gvk.Kind == "Application" && (resHealth.Status == health.HealthStatusMissing || resHealth.Status == health.HealthStatusUnknown) {
if gvk.Group == "argoproj.io" && gvk.Kind == "Application" && (resHealth.Status == health.HealthStatusMissing || resHealth.Status == health.HealthStatusUnknown || resHealth.Status == health.HealthStatusDegraded) {
// Covers the app-of-apps corner case where child app is deployed but that app itself
// has a status of 'Missing', which we don't want to cause the parent's health status
// to also be Missing
// to also be Missing. Default changed so that if a child app has a degraded health status,
// it will not affect the parent's health status.
return true
}
}
Expand Down
4 changes: 2 additions & 2 deletions util/health/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ func TestAppOfAppsHealth(t *testing.T) {
assert.Equal(t, health.HealthStatusHealthy, healthStatus.Status)
}

// verify degraded does affect
// verify degraded does not affect app health
{
degradedAndHealthyStatuses := []*appv1.ResourceStatus{degradedStatus, healthyStatus}
degradedAndHealthyLiveObjects := []*unstructured.Unstructured{degradedApp, healthyApp}
healthStatus, err := SetApplicationHealth(degradedAndHealthyStatuses, degradedAndHealthyLiveObjects, nil, noFilter)
assert.NoError(t, err)
assert.Equal(t, health.HealthStatusDegraded, healthStatus.Status)
assert.Equal(t, health.HealthStatusHealthy, healthStatus.Status)
}

}
Expand Down