Skip to content

Commit

Permalink
cleanup lint errors in clusterapi
Browse files Browse the repository at this point in the history
  • Loading branch information
elmiko committed Apr 29, 2022
1 parent 366700d commit 9450e75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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) {
Expand Down

0 comments on commit 9450e75

Please sign in to comment.