From f42f79edb073798e1f40ad9867653087e66a842c Mon Sep 17 00:00:00 2001 From: Shiyang Wang Date: Fri, 24 Nov 2017 18:06:20 +0800 Subject: [PATCH] fix spaces around the / --- pkg/printers/internalversion/printers.go | 8 ++++---- pkg/printers/internalversion/printers_test.go | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/printers/internalversion/printers.go b/pkg/printers/internalversion/printers.go index 2c52c5e22fe..9811a64f348 100644 --- a/pkg/printers/internalversion/printers.go +++ b/pkg/printers/internalversion/printers.go @@ -1483,20 +1483,20 @@ func formatHPAMetrics(specs []autoscaling.MetricSpec, statuses []autoscaling.Met if len(statuses) > i && statuses[i].Pods != nil { current = statuses[i].Pods.CurrentAverageValue.String() } - list = append(list, fmt.Sprintf("%s / %s", current, spec.Pods.TargetAverageValue.String())) + list = append(list, fmt.Sprintf("%s/%s", current, spec.Pods.TargetAverageValue.String())) case autoscaling.ObjectMetricSourceType: current := "" if len(statuses) > i && statuses[i].Object != nil { current = statuses[i].Object.CurrentValue.String() } - list = append(list, fmt.Sprintf("%s / %s", current, spec.Object.TargetValue.String())) + list = append(list, fmt.Sprintf("%s/%s", current, spec.Object.TargetValue.String())) case autoscaling.ResourceMetricSourceType: if spec.Resource.TargetAverageValue != nil { current := "" if len(statuses) > i && statuses[i].Resource != nil { current = statuses[i].Resource.CurrentAverageValue.String() } - list = append(list, fmt.Sprintf("%s / %s", current, spec.Resource.TargetAverageValue.String())) + list = append(list, fmt.Sprintf("%s/%s", current, spec.Resource.TargetAverageValue.String())) } else { current := "" if len(statuses) > i && statuses[i].Resource != nil && statuses[i].Resource.CurrentAverageUtilization != nil { @@ -1507,7 +1507,7 @@ func formatHPAMetrics(specs []autoscaling.MetricSpec, statuses []autoscaling.Met if spec.Resource.TargetAverageUtilization != nil { target = fmt.Sprintf("%d%%", *spec.Resource.TargetAverageUtilization) } - list = append(list, fmt.Sprintf("%s / %s", current, target)) + list = append(list, fmt.Sprintf("%s/%s", current, target)) } default: list = append(list, "") diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go index 8662c91fc37..f20c4191815 100644 --- a/pkg/printers/internalversion/printers_test.go +++ b/pkg/printers/internalversion/printers_test.go @@ -2182,7 +2182,7 @@ func TestPrintHPA(t *testing.T) { DesiredReplicas: 5, }, }, - "some-hpa\tReplicationController/some-rc\t / 100m\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t/100m\t2\t10\t4\t\n", }, // pods source type { @@ -2219,7 +2219,7 @@ func TestPrintHPA(t *testing.T) { }, }, }, - "some-hpa\tReplicationController/some-rc\t50m / 100m\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t50m/100m\t2\t10\t4\t\n", }, // object source type (no current) { @@ -2251,7 +2251,7 @@ func TestPrintHPA(t *testing.T) { DesiredReplicas: 5, }, }, - "some-hpa\tReplicationController/some-rc\t / 100m\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t/100m\t2\t10\t4\t\n", }, // object source type { @@ -2296,7 +2296,7 @@ func TestPrintHPA(t *testing.T) { }, }, }, - "some-hpa\tReplicationController/some-rc\t50m / 100m\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t50m/100m\t2\t10\t4\t\n", }, // resource source type, targetVal (no current) { @@ -2324,7 +2324,7 @@ func TestPrintHPA(t *testing.T) { DesiredReplicas: 5, }, }, - "some-hpa\tReplicationController/some-rc\t / 100m\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t/100m\t2\t10\t4\t\n", }, // resource source type, targetVal { @@ -2361,7 +2361,7 @@ func TestPrintHPA(t *testing.T) { }, }, }, - "some-hpa\tReplicationController/some-rc\t50m / 100m\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t50m/100m\t2\t10\t4\t\n", }, // resource source type, targetUtil (no current) { @@ -2389,7 +2389,7 @@ func TestPrintHPA(t *testing.T) { DesiredReplicas: 5, }, }, - "some-hpa\tReplicationController/some-rc\t / 80%\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t/80%\t2\t10\t4\t\n", }, // resource source type, targetUtil { @@ -2427,7 +2427,7 @@ func TestPrintHPA(t *testing.T) { }, }, }, - "some-hpa\tReplicationController/some-rc\t50% / 80%\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t50%/80%\t2\t10\t4\t\n", }, // multiple specs { @@ -2486,7 +2486,7 @@ func TestPrintHPA(t *testing.T) { }, }, }, - "some-hpa\tReplicationController/some-rc\t50m / 100m, 50% / 80% + 1 more...\t2\t10\t4\t\n", + "some-hpa\tReplicationController/some-rc\t50m/100m, 50%/80% + 1 more...\t2\t10\t4\t\n", }, }