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 a762e2f
Showing 1 changed file with 4 additions and 5 deletions.
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 a762e2f

Please sign in to comment.