From 9450e7597b276d94b5003b4127c8833a0124d1bb Mon Sep 17 00:00:00 2001 From: Michael McCune Date: Fri, 29 Apr 2022 14:34:16 -0400 Subject: [PATCH] cleanup lint errors in clusterapi --- .../cloudprovider/clusterapi/clusterapi_controller.go | 2 +- .../cloudprovider/clusterapi/clusterapi_utils.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller.go b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller.go index 29b4480d3250..9f5ff295ff91 100644 --- a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller.go +++ b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller.go @@ -731,7 +731,7 @@ func (c *machineController) allowedByAutoDiscoverySpecs(r *unstructured.Unstruct // infrastructure template objects. A local cache is used in favor of the // client-go informers because of the frequency of read requests combined // with the fact that the infrastructure template will not be updated -// frequently (if at all). In practice, // the autoscaler can make calls to +// frequently (if at all). In practice, the autoscaler can make calls to // the API server at a high frequency, which results in many calls being // throttled on the client-side. To reduce the amount of throttling we keep // an in-memory cache of infrastructure templates. The cache has a time to diff --git a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_utils.go b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_utils.go index 47f987185a9d..eb1593214d39 100644 --- a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_utils.go +++ b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_utils.go @@ -196,11 +196,11 @@ func parseKey(annotations map[string]string, key string) (resource.Quantity, err func parseIntKey(annotations map[string]string, key string) (resource.Quantity, error) { if val, exists := annotations[key]; exists && val != "" { - if valInt, err := strconv.ParseInt(val, 10, 0); err != nil { + valInt, err := strconv.ParseInt(val, 10, 0) + if err != nil { return zeroQuantity.DeepCopy(), fmt.Errorf("value %q from annotation %q expected to be an integer: %v", val, key, err) - } else { - return *resource.NewQuantity(valInt, resource.DecimalSI), nil } + return *resource.NewQuantity(valInt, resource.DecimalSI), nil } return zeroQuantity.DeepCopy(), nil } @@ -224,9 +224,8 @@ func parseGPUCount(annotations map[string]string) (resource.Quantity, error) { func parseGPUType(annotations map[string]string) string { if val, found := annotations[gpuTypeKey]; found { return val - } else { - return "" } + return "" } func parseMaxPodsCapacity(annotations map[string]string) (resource.Quantity, error) {