Update kubectl to display HPA status conditions

This commit updates `kubectl describe` to display the new HPA
status conditions.  This should make it easier for users to discern
the current state of the HPA.
This commit is contained in:
Solly Ross 2017-05-26 18:21:16 -04:00
parent 1334b81d20
commit 53dccdbb43

View File

@ -2627,6 +2627,14 @@ func describeHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, e
w.Write(LEVEL_0, "failed to check Replication Controller\n")
}
}
if len(hpa.Status.Conditions) > 0 {
w.Write(LEVEL_0, "Conditions:\n")
w.Write(LEVEL_1, "Type\tStatus\tReason\tMessage\n")
w.Write(LEVEL_1, "----\t------\t------\t-------\n")
for _, c := range hpa.Status.Conditions {
w.Write(LEVEL_1, "%v\t%v\t%v\t%v\n", c.Type, c.Status, c.Reason, c.Message)
}
}
if events != nil {
DescribeEvents(events, w)