From a762e2f26e9ce3e169821c2c363f108e482b3bac 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_utils.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) {