From 897d239fcb702a62857602ad7236d966ce95bb74 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Fri, 22 Mar 2024 07:51:59 +0100 Subject: [PATCH] Bump compose-go to v2.0.2 Signed-off-by: Nicolas De Loof --- go.mod | 2 +- go.sum | 4 ++-- pkg/compose/create.go | 6 ++---- pkg/e2e/config_test.go | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 2103cdd57..2108e2109 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 github.com/Microsoft/go-winio v0.6.1 github.com/buger/goterm v1.0.4 - github.com/compose-spec/compose-go/v2 v2.0.0 + github.com/compose-spec/compose-go/v2 v2.0.2 github.com/containerd/console v1.0.3 github.com/containerd/containerd v1.7.12 github.com/davecgh/go-spew v1.1.1 diff --git a/go.sum b/go.sum index cfb3e697b..0ac40b9ca 100644 --- a/go.sum +++ b/go.sum @@ -86,8 +86,8 @@ github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+g github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= -github.com/compose-spec/compose-go/v2 v2.0.0 h1:RLI8GmNxRLg759CzZITh/kGYZTYhEak121FaVYdXTC8= -github.com/compose-spec/compose-go/v2 v2.0.0/go.mod h1:bEPizBkIojlQ20pi2vNluBa58tevvj0Y18oUSHPyfdc= +github.com/compose-spec/compose-go/v2 v2.0.2 h1:zhXMV7VWI00Su0LdKt8/sxeXxcjLWhmGmpEyw+ZYznI= +github.com/compose-spec/compose-go/v2 v2.0.2/go.mod h1:bEPizBkIojlQ20pi2vNluBa58tevvj0Y18oUSHPyfdc= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= diff --git a/pkg/compose/create.go b/pkg/compose/create.go index 66b052eb4..ad66314f6 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -711,10 +711,8 @@ func setLimits(limits *types.Resource, resources *container.Resources) { if limits.MemoryBytes != 0 { resources.Memory = int64(limits.MemoryBytes) } - if limits.NanoCPUs != "" { - if f, err := strconv.ParseFloat(limits.NanoCPUs, 64); err == nil { - resources.NanoCPUs = int64(f * 1e9) - } + if limits.NanoCPUs != 0 { + resources.NanoCPUs = int64(limits.NanoCPUs * 1e9) } if limits.Pids > 0 { resources.PidsLimit = &limits.Pids diff --git a/pkg/e2e/config_test.go b/pkg/e2e/config_test.go index aa183ea6c..6fef7bc02 100644 --- a/pkg/e2e/config_test.go +++ b/pkg/e2e/config_test.go @@ -39,7 +39,7 @@ func TestLocalComposeConfig(t *testing.T) { t.Run("json", func(t *testing.T) { res := c.RunDockerComposeCmd(t, "-f", "./fixtures/config/compose.yaml", "--project-name", projectName, "config", "--format", "json") - res.Assert(t, icmd.Expected{Out: `ports":[{"mode":"ingress","target":80,"published":"8080","protocol":"tcp"}]`}) + res.Assert(t, icmd.Expected{Out: `"published": "8080"`}) }) t.Run("--no-interpolate", func(t *testing.T) {