From 853c33358a511388d3a2c71707c6a22be70774d3 Mon Sep 17 00:00:00 2001 From: SataQiu Date: Wed, 24 Apr 2019 15:13:01 +0800 Subject: [PATCH] fix golint failures of pkg/apis/autoscaling --- hack/.golint_failures | 1 - pkg/apis/autoscaling/register.go | 4 +++- pkg/apis/autoscaling/types.go | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hack/.golint_failures b/hack/.golint_failures index 8ab29fc3b7a..e122fb993e7 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -17,7 +17,6 @@ pkg/apis/authentication/v1 pkg/apis/authorization pkg/apis/authorization/v1 pkg/apis/authorization/validation -pkg/apis/autoscaling pkg/apis/autoscaling/v1 pkg/apis/autoscaling/v2beta1 pkg/apis/autoscaling/v2beta2 diff --git a/pkg/apis/autoscaling/register.go b/pkg/apis/autoscaling/register.go index 6c321a3abab..871e5513a52 100644 --- a/pkg/apis/autoscaling/register.go +++ b/pkg/apis/autoscaling/register.go @@ -38,8 +38,10 @@ func Resource(resource string) schema.GroupResource { } var ( + // SchemeBuilder points to a list of functions added to Scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme + // AddToScheme applies all the stored functions to the scheme. + AddToScheme = SchemeBuilder.AddToScheme ) // Adds the list of known types to the given scheme. diff --git a/pkg/apis/autoscaling/types.go b/pkg/apis/autoscaling/types.go index 4ab6f8aff55..051f797f731 100644 --- a/pkg/apis/autoscaling/types.go +++ b/pkg/apis/autoscaling/types.go @@ -226,8 +226,11 @@ type MetricTarget struct { type MetricTargetType string var ( - UtilizationMetricType MetricTargetType = "Utilization" - ValueMetricType MetricTargetType = "Value" + // UtilizationMetricType is a possible value for MetricTarget.Type. + UtilizationMetricType MetricTargetType = "Utilization" + // ValueMetricType is a possible value for MetricTarget.Type. + ValueMetricType MetricTargetType = "Value" + // AverageValueMetricType is a possible value for MetricTarget.Type. AverageValueMetricType MetricTargetType = "AverageValue" ) @@ -373,6 +376,7 @@ type ExternalMetricStatus struct { Current MetricValueStatus } +// MetricValueStatus indicates the current value of a metric. type MetricValueStatus struct { Value *resource.Quantity AverageValue *resource.Quantity