func GetHealthCheckFunc(gvk schema.GroupVersionKind) func(obj *unstructured.Unstructured) (*HealthStatus, error) {
switch gvk.Group {
...
case "argoproj.io":
switch gvk.Kind {
case "Workflow":
return getArgoWorkflowHealth
case "Application":
return getArgoAppHealth
}
...
pkg/health/health_argo.go
// An agnostic app object only considers Status.Phase and Status.Message. It is agnostic to the API version or any
// other fields.
type argoApp struct {
Status struct {
Health HealthStatus `json:"health,omitempty"`
}
}
func getArgoAppHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
var app argoApp
err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &app)
if err != nil {
return nil, err
}
return &app.Status.health, nil
}
Summary
Currently when ApplicationSet is present in the tree, the generated Applications are present as well.
However the status is not displayed while for a deployment the RS and the Pod status is:
Here is a sample to test: https://github.com/speedfl/argocd-apps-of-applicationset
Motivation
It could be useful to see the status of the App (Healthy/Degraded/Unknow)
Bonus: Sync status
Proposal
While debuging UI I noticed that
apps
does not return the status of the Applications.Go to Application
grievances-five
and sync it. Then go back onapps
:Returns without health status
Go to Application
grievances-five
Returns with health status
The issue is due to
pkg/health/health.go
I tried to fix it with:
pkg/health/health.go
pkg/health/health_argo.go
Link: https://github.com/speedfl/argocd-apps-of-applicationset/tree/feature/fix-e2e
Status seems returned in UI
However I notice in Unit test that it is explicitely requested to have nil for Application: https://github.com/argoproj/gitops-engine/blob/master/pkg/health/health_test.go#L109-L112
Any reason ? Looking at all the usage in Argocd I don't see any reason why Application must be excluded