diff --git a/go.mod b/go.mod index 61ac0f41bd..f9470e9494 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go index d7d50f7b37..811bb70e21 100644 --- a/pkg/trait/jvm.go +++ b/pkg/trait/jvm.go @@ -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" @@ -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