From bff44ff4662821da161e89938dabeb5045155142 Mon Sep 17 00:00:00 2001 From: Guillaume Lours Date: Mon, 1 Aug 2022 16:57:57 +0200 Subject: [PATCH 1/2] update to compose-go v1.4.0 as previous version introduced breaking changes Signed-off-by: Guillaume Lours --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 290971b8be..5796b9374e 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.5 github.com/buger/goterm v1.0.4 github.com/cnabio/cnab-to-oci v0.3.5 - github.com/compose-spec/compose-go v1.3.0 + github.com/compose-spec/compose-go v1.4.0 github.com/containerd/console v1.0.3 github.com/containerd/containerd v1.6.6 github.com/distribution/distribution/v3 v3.0.0-20220725133111-4bf3547399eb diff --git a/go.sum b/go.sum index 14a72377b0..5d8658224f 100644 --- a/go.sum +++ b/go.sum @@ -286,8 +286,8 @@ github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoC github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/compose-spec/compose-go v1.2.1/go.mod h1:pAy7Mikpeft4pxkFU565/DRHEbDfR84G6AQuiL+Hdg8= -github.com/compose-spec/compose-go v1.3.0 h1:n5fSOUXQsfnCpn/lZBgNM3qEu1PDhvcbWrWXVBlUNmA= -github.com/compose-spec/compose-go v1.3.0/go.mod h1:l7RUULbFFLzlQHuxtJr7SVLyWdqEpbJEGTWCgcu6Eqw= +github.com/compose-spec/compose-go v1.4.0 h1:zaYVAZ6lIByr7Jffi20AabfeUwcTrdXfH3X1R5HEm+g= +github.com/compose-spec/compose-go v1.4.0/go.mod h1:l7RUULbFFLzlQHuxtJr7SVLyWdqEpbJEGTWCgcu6Eqw= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= From 052469104f8847ac7af5866ad5a4434fb366eb72 Mon Sep 17 00:00:00 2001 From: Guillaume Lours Date: Mon, 1 Aug 2022 17:25:43 +0200 Subject: [PATCH 2/2] switch tests back to '_' separator for networks and volumes Signed-off-by: Guillaume Lours --- pkg/e2e/compose_test.go | 6 +++--- pkg/e2e/networks_test.go | 6 +++--- pkg/e2e/volumes_test.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/e2e/compose_test.go b/pkg/e2e/compose_test.go index 0e591c44bf..f2ac2ad183 100644 --- a/pkg/e2e/compose_test.go +++ b/pkg/e2e/compose_test.go @@ -49,7 +49,7 @@ func TestLocalComposeUp(t *testing.T) { assert.Assert(t, strings.Contains(output, `"word":`)) res = c.RunDockerCmd(t, "network", "ls") - res.Assert(t, icmd.Expected{Out: projectName + "-default"}) + res.Assert(t, icmd.Expected{Out: projectName + "_default"}) }) t.Run("top", func(t *testing.T) { @@ -74,7 +74,7 @@ func TestLocalComposeUp(t *testing.T) { res.Assert(t, icmd.Expected{Out: `"com.docker.compose.service": "web"`}) res.Assert(t, icmd.Expected{Out: `"com.docker.compose.version":`}) - res = c.RunDockerCmd(t, "network", "inspect", projectName+"-default") + res = c.RunDockerCmd(t, "network", "inspect", projectName+"_default") res.Assert(t, icmd.Expected{Out: `"com.docker.compose.network": "default"`}) res.Assert(t, icmd.Expected{Out: `"com.docker.compose.project": `}) res.Assert(t, icmd.Expected{Out: `"com.docker.compose.version": `}) @@ -241,6 +241,6 @@ func TestConvert(t *testing.T) { default: null networks: default: - name: compose-e2e-convert-default`, filepath.Join(wd, "fixtures", "simple-build-test", "nginx-build")), ExitCode: 0}) + name: compose-e2e-convert_default`, filepath.Join(wd, "fixtures", "simple-build-test", "nginx-build")), ExitCode: 0}) }) } diff --git a/pkg/e2e/networks_test.go b/pkg/e2e/networks_test.go index c7920b417a..9264c76cf8 100644 --- a/pkg/e2e/networks_test.go +++ b/pkg/e2e/networks_test.go @@ -52,7 +52,7 @@ func TestNetworks(t *testing.T) { assert.Assert(t, strings.Contains(output, `"word":`)) res = c.RunDockerCmd(t, "network", "ls") - res.Assert(t, icmd.Expected{Out: projectName + "-dbnet"}) + res.Assert(t, icmd.Expected{Out: projectName + "_dbnet"}) res.Assert(t, icmd.Expected{Out: "microservices"}) }) @@ -126,7 +126,7 @@ func TestIPAMConfig(t *testing.T) { const projectName = "ipam_e2e" t.Run("ensure we do not reuse previous networks", func(t *testing.T) { - c.RunDockerOrExitError(t, "network", "rm", projectName+"-default") + c.RunDockerOrExitError(t, "network", "rm", projectName+"_default") }) t.Run("up", func(t *testing.T) { @@ -135,7 +135,7 @@ func TestIPAMConfig(t *testing.T) { t.Run("ensure service get fixed IP assigned", func(t *testing.T) { res := c.RunDockerCmd(t, "inspect", projectName+"-foo-1", "-f", - fmt.Sprintf(`{{ $network := index .NetworkSettings.Networks "%s-default" }}{{ $network.IPAMConfig.IPv4Address }}`, projectName)) + fmt.Sprintf(`{{ $network := index .NetworkSettings.Networks "%s_default" }}{{ $network.IPAMConfig.IPv4Address }}`, projectName)) res.Assert(t, icmd.Expected{Out: "10.1.0.100"}) }) diff --git a/pkg/e2e/volumes_test.go b/pkg/e2e/volumes_test.go index fc6cd31c12..604b3ba6c0 100644 --- a/pkg/e2e/volumes_test.go +++ b/pkg/e2e/volumes_test.go @@ -107,7 +107,7 @@ func TestProjectVolumeBind(t *testing.T) { c.RunDockerComposeCmd(t, "--project-name", projectName, "down") - c.RunDockerOrExitError(t, "volume", "rm", "-f", projectName+"-project-data").Assert(t, icmd.Success) + c.RunDockerOrExitError(t, "volume", "rm", "-f", projectName+"_project-data").Assert(t, icmd.Success) cmd := c.NewCmdWithEnv([]string{"TEST_DIR=" + tmpDir}, "docker", "compose", "--project-directory", "fixtures/project-volume-bind-test", "--project-name", projectName, "up", "-d") icmd.RunCmd(cmd).Assert(t, icmd.Success)