From 1ad72123747eddf441d1e609fd95141462cd41b5 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Wed, 24 Jul 2024 09:50:47 -0400 Subject: [PATCH 1/2] fix: ignore resource requests for the docker runner Signed-off-by: Jason Hall --- pkg/container/docker/docker_runner.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/pkg/container/docker/docker_runner.go b/pkg/container/docker/docker_runner.go index 1af5ac551..fda74ab4c 100644 --- a/pkg/container/docker/docker_runner.go +++ b/pkg/container/docker/docker_runner.go @@ -39,7 +39,6 @@ import ( v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1/empty" image_spec "github.com/opencontainers/image-spec/specs-go/v1" - "k8s.io/apimachinery/pkg/api/resource" ) var _ mcontainer.Debugger = (*docker)(nil) @@ -98,23 +97,7 @@ func (dk *docker) StartPod(ctx context.Context, cfg *mcontainer.Config) error { } hostConfig := &container.HostConfig{ - Mounts: mounts, - Resources: container.Resources{}, - } - - if cfg.CPU != "" { - res, err := resource.ParseQuantity(cfg.CPU) - if err != nil { - return fmt.Errorf("parsing CPU resource: %w", err) - } - hostConfig.Resources.NanoCPUs = int64(res.AsApproximateFloat64() * 1000000000) - } - if cfg.Memory != "" { - res, err := resource.ParseQuantity(cfg.Memory) - if err != nil { - return fmt.Errorf("parsing memory resource: %w", err) - } - hostConfig.Resources.Memory = res.Value() + Mounts: mounts, } platform := &image_spec.Platform{ From 5dfe0a98d34b21c58d340949a0c2fda051010d92 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Wed, 24 Jul 2024 09:56:33 -0400 Subject: [PATCH 2/2] go mod tidy Signed-off-by: Jason Hall --- go.mod | 3 +-- go.sum | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/go.mod b/go.mod index f25689029..abf4c5232 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,6 @@ require ( google.golang.org/api v0.189.0 gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/apimachinery v0.30.3 k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f sigs.k8s.io/release-utils v0.8.3 ) @@ -179,8 +178,8 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect google.golang.org/grpc v1.64.1 // indirect google.golang.org/protobuf v1.34.2 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect + k8s.io/apimachinery v0.30.3 // indirect k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect mvdan.cc/sh/v3 v3.8.0 // indirect ) diff --git a/go.sum b/go.sum index 72d917525..4d4d7c0da 100644 --- a/go.sum +++ b/go.sum @@ -211,8 +211,6 @@ github.com/google/go-github/v54 v54.0.0 h1:OZdXwow4EAD5jEo5qg+dGFH2DpkyZvVsAehjv github.com/google/go-github/v54 v54.0.0/go.mod h1:Sw1LXWHhXRZtzJ9LI5fyJg9wbQzYvFhW8W5P2yaAQ7s= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -580,8 +578,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=