Skip to content

Commit

Permalink
chore(deps): remove gopkg.in/inf.v0
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed May 22, 2023
1 parent 2a7da6b commit e0abbda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ require (
golang.org/x/term v0.8.0
golang.org/x/text v0.9.0
golang.org/x/time v0.3.0
gopkg.in/inf.v0 v0.9.1
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.25.6
k8s.io/apiextensions-apiserver v0.25.6
Expand Down Expand Up @@ -157,6 +156,7 @@ require (
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
google.golang.org/grpc v1.52.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.25.6 // indirect
Expand Down
6 changes: 2 additions & 4 deletions pkg/trait/jvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (

"github.com/scylladb/go-set/strset"

infp "gopkg.in/inf.v0"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -225,8 +223,8 @@ func (t *jvmTrait) Apply(e *Environment) error {
if resource.NewScaledQuantity(300, 6).Cmp(memory) > 0 {
percentage = 25
}
memory.AsDec().Mul(memory.AsDec(), infp.NewDec(percentage, 2))
args = append(args, fmt.Sprintf("-Xmx%dM", memory.ScaledValue(resource.Mega)))
memScaled := memory.ScaledValue(resource.Mega) * percentage / 100
args = append(args, fmt.Sprintf("-Xmx%dM", memScaled))
}

// Add mounted resources to the class path
Expand Down

0 comments on commit e0abbda

Please sign in to comment.