diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index 0722389f5367..3f13ec4f9a98 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -1271,8 +1271,12 @@ func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string) (str fmt.Fprintf(out, "\n") } } - fmt.Fprintf(out, "Min pods:\t%d\n", hpa.Spec.MinReplicas) - fmt.Fprintf(out, "Max pods:\t%d\n", hpa.Spec.MaxReplicas) + minReplicas := "" + if hpa.Spec.MinReplicas != nil { + minReplicas = fmt.Sprintf("%d", *hpa.Spec.MinReplicas) + } + fmt.Fprintf(out, "Min replicas:\t%s\n", minReplicas) + fmt.Fprintf(out, "Max replicas:\t%d\n", hpa.Spec.MaxReplicas) // TODO: switch to scale subresource once the required code is submitted. if strings.ToLower(hpa.Spec.ScaleRef.Kind) == "replicationcontroller" {