From 53dccdbb43d9567da65e9dbf3eaa49eb2904511d Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Fri, 26 May 2017 18:21:16 -0400 Subject: [PATCH] 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. --- pkg/printers/internalversion/describe.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go index 707566088e2..d9bc529328a 100644 --- a/pkg/printers/internalversion/describe.go +++ b/pkg/printers/internalversion/describe.go @@ -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)