Files
deploy/gitops-engine/pkg/health/health_ingress.go
2025-09-23 10:05:42 -04:00

17 lines
421 B
Go

package health
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
func getIngressHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
ingresses, _, _ := unstructured.NestedSlice(obj.Object, "status", "loadBalancer", "ingress")
health := HealthStatus{}
if len(ingresses) > 0 {
health.Status = HealthStatusHealthy
} else {
health.Status = HealthStatusProgressing
}
return &health, nil
}