Merge pull request #16025 from piosz/describe-fix

Fixed incorrect Min replicas value in kubectl describe
pull/6/head
Filip Grzadkowski 2015-10-23 14:07:16 +02:00
commit d93c14afec
1 changed files with 6 additions and 2 deletions

View File

@ -1271,8 +1271,12 @@ func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string) (str
fmt.Fprintf(out, "<not available>\n")
}
}
fmt.Fprintf(out, "Min pods:\t%d\n", hpa.Spec.MinReplicas)
fmt.Fprintf(out, "Max pods:\t%d\n", hpa.Spec.MaxReplicas)
minReplicas := "<unset>"
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" {