Skip to content

Commit

Permalink
fix: lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Jun 24, 2024
1 parent 43d260b commit 90205f6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions kubernetes/quantity.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
)

func _k8sCPUAsMillicores(objVal string) int64 {
var cpu int64
if strings.HasSuffix(objVal, "m") {
cpu = conv.ToInt64(strings.ReplaceAll(objVal, "m", ""))
} else if strings.HasSuffix(objVal, "n") {
cpu = conv.ToInt64(strings.ReplaceAll(objVal, "n", "")) / (1000 * 1000)
} else {
cpu = int64(conv.ToFloat64(objVal) * 1000)
return conv.ToInt64(strings.ReplaceAll(objVal, "m", ""))
}
return cpu

if strings.HasSuffix(objVal, "n") {
return conv.ToInt64(strings.ReplaceAll(objVal, "n", "")) / (1000 * 1000)
}

return int64(conv.ToFloat64(objVal) * 1000)
}

func k8sCPUAsMillicores() cel.EnvOption {
Expand Down

0 comments on commit 90205f6

Please sign in to comment.