mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 03:38:04 +00:00
Handled resource kind PodDisruptionBudget and CRD for health status. (#448)
* Handled resource kind PodDisruptionBudget and CRD for health status. * Handled resource kind PodDisruptionBudget and CRD for health status. --------- Co-authored-by: vkumar3 <vkumar@aarnanetworks.com>
This commit is contained in:
@@ -82,6 +82,7 @@ func EnhanceStatus(res *v12.Carp, err error) *v12.CarpStatus {
|
|||||||
c.Status = Unhealthy
|
c.Status = Unhealthy
|
||||||
} else if slices.Contains([]string{"Available", "Active", "Established", "Bound", "Ready"}, string(s.Phase)) {
|
} else if slices.Contains([]string{"Available", "Active", "Established", "Bound", "Ready"}, string(s.Phase)) {
|
||||||
c.Status = Healthy
|
c.Status = Healthy
|
||||||
|
c.Reason = "Exists" //since there is no condition to check here, we can set reason as exists.
|
||||||
} else if s.Phase == "" && len(s.Conditions) > 0 {
|
} else if s.Phase == "" && len(s.Conditions) > 0 {
|
||||||
for _, cond := range s.Conditions {
|
for _, cond := range s.Conditions {
|
||||||
if cond.Type == "Progressing" { // https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
|
if cond.Type == "Progressing" { // https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
|
||||||
@@ -102,6 +103,22 @@ func EnhanceStatus(res *v12.Carp, err error) *v12.CarpStatus {
|
|||||||
}
|
}
|
||||||
c.Reason = cond.Reason
|
c.Reason = cond.Reason
|
||||||
c.Message = cond.Message
|
c.Message = cond.Message
|
||||||
|
} else if cond.Type == "DisruptionAllowed" && c.Status == Unknown { //condition for PodDisruptionBudget
|
||||||
|
if cond.Status == "False" {
|
||||||
|
c.Status = Unhealthy
|
||||||
|
} else {
|
||||||
|
c.Status = Healthy
|
||||||
|
}
|
||||||
|
c.Reason = cond.Reason
|
||||||
|
c.Message = cond.Message
|
||||||
|
} else if (cond.Type == "Established" || cond.Type == "NamesAccepted") && (c.Status == Unknown || c.Status == Healthy) { //condition for CRD
|
||||||
|
if cond.Status == "False" {
|
||||||
|
c.Status = Unhealthy
|
||||||
|
} else {
|
||||||
|
c.Status = Healthy
|
||||||
|
}
|
||||||
|
c.Reason = cond.Reason
|
||||||
|
c.Message = cond.Message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if s.Phase == "Pending" {
|
} else if s.Phase == "Pending" {
|
||||||
|
|||||||
Reference in New Issue
Block a user