From 501b5acde6ea60da7105fd0ec9b320ab7ed3748b Mon Sep 17 00:00:00 2001 From: Laura Brehm Date: Wed, 30 Oct 2024 12:04:18 +0000 Subject: [PATCH 1/5] Update `MAINTAINERS` file Add `jhrotko` to Core Maintainers. Signed-off-by: Laura Brehm --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3d3778766e2..a7810eccd79 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -23,6 +23,7 @@ people = [ "glours", + "jhrotko", "milas", "ndeloof", "nicksieger", @@ -72,6 +73,11 @@ Email = "guillaume.tardif@docker.com" GitHub = "gtardif" + [people.jhrotko] + Name = "Joana Hrotko" + Email = "joana.hrotko@docker.com" + Github = "jhrotko" + [people.laurazard] Name = "Laura Brehm" Email = "laura.brehm@docker.com" From eececb9add3748fce765c3094575d3c52d8cfdbf Mon Sep 17 00:00:00 2001 From: Joana Hrotko Date: Wed, 30 Oct 2024 12:09:34 +0000 Subject: [PATCH 2/5] Add profile e2e test case to document in compose Signed-off-by: Joana Hrotko --- pkg/e2e/fixtures/profiles/docker-compose.yaml | 15 +++++++++++++++ pkg/e2e/up_test.go | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 pkg/e2e/fixtures/profiles/docker-compose.yaml diff --git a/pkg/e2e/fixtures/profiles/docker-compose.yaml b/pkg/e2e/fixtures/profiles/docker-compose.yaml new file mode 100644 index 00000000000..134d7bbc9bf --- /dev/null +++ b/pkg/e2e/fixtures/profiles/docker-compose.yaml @@ -0,0 +1,15 @@ +services: + foo: + container_name: foo_c + profiles: [ test ] + image: alpine + depends_on: [ db ] + + bar: + container_name: bar_c + profiles: [ test ] + image: alpine + + db: + container_name: db_c + image: alpine \ No newline at end of file diff --git a/pkg/e2e/up_test.go b/pkg/e2e/up_test.go index e6e138c3bce..83ce235a1d4 100644 --- a/pkg/e2e/up_test.go +++ b/pkg/e2e/up_test.go @@ -179,3 +179,16 @@ func TestUpWithAllResources(t *testing.T) { assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Volume "%s_my_vol" Created`, projectName)), res.Combined()) assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Network %s_my_net Created`, projectName)), res.Combined()) } + +func TestUpProfile(t *testing.T) { + c := NewCLI(t) + const projectName = "compose-e2e-up-profile" + t.Cleanup(func() { + c.RunDockerComposeCmd(t, "--project-name", projectName, "--profile", "test", "down", "-v") + }) + + res := c.RunDockerComposeCmd(t, "-f", "./fixtures/profiles/docker-compose.yaml", "--project-name", projectName, "up", "foo") + assert.Assert(t, strings.Contains(res.Combined(), `Container db_c Created`), res.Combined()) + assert.Assert(t, strings.Contains(res.Combined(), `Container foo_c Created`), res.Combined()) + assert.Assert(t, !strings.Contains(res.Combined(), `Container bar_c Created`), res.Combined()) +} From 513b6128c202abe8dcd4ddbe19fad640c7a97b26 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 5 Nov 2024 07:37:14 +0100 Subject: [PATCH 3/5] Service being declared in a profile must not trigger re-creation Signed-off-by: Nicolas De Loof --- pkg/compose/hash.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/compose/hash.go b/pkg/compose/hash.go index e6a189bd8db..f284a84e093 100644 --- a/pkg/compose/hash.go +++ b/pkg/compose/hash.go @@ -33,6 +33,7 @@ func ServiceHash(o types.ServiceConfig) (string, error) { o.Deploy.Replicas = nil } o.DependsOn = nil + o.Profiles = nil bytes, err := json.Marshal(o) if err != nil { From 361c0893a9e16d54f535cdb2e764362363d40702 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 09:06:30 +0000 Subject: [PATCH 4/5] build(deps): bump github.com/compose-spec/compose-go/v2 Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.2 to 2.4.3. - [Release notes](https://github.com/compose-spec/compose-go/releases) - [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.2...v2.4.3) --- updated-dependencies: - dependency-name: github.com/compose-spec/compose-go/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8a1591ffadf..5ae56d8af36 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d github.com/buger/goterm v1.0.4 - github.com/compose-spec/compose-go/v2 v2.4.2 + github.com/compose-spec/compose-go/v2 v2.4.3 github.com/containerd/containerd v1.7.23 github.com/containerd/platforms v0.2.1 github.com/davecgh/go-spew v1.1.1 diff --git a/go.sum b/go.sum index 03d29a945c2..f7c17589163 100644 --- a/go.sum +++ b/go.sum @@ -85,8 +85,8 @@ github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 h1:N+3sFI5GUjRKBi+i0Tx github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= 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.4.2 h1:RaZv+ZKZVNmxi4Cww1EKiJRLSZLiqVxIqhLUdH92dz4= -github.com/compose-spec/compose-go/v2 v2.4.2/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc= +github.com/compose-spec/compose-go/v2 v2.4.3 h1:4+Nd9IqIGobbPles9ZuRS5uJfFfRgBo4Wdcv+8VNex8= +github.com/compose-spec/compose-go/v2 v2.4.3/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc= 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.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro= From a000978980f10c742033381cd74f39d441ab72b1 Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:26:44 +0100 Subject: [PATCH 5/5] remove ArtifactType from Config in OCI v1.1 definition of the artifact Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- internal/ocipush/push.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/ocipush/push.go b/internal/ocipush/push.go index d9a7f6ec043..0296f67da46 100644 --- a/internal/ocipush/push.go +++ b/internal/ocipush/push.go @@ -178,7 +178,6 @@ func generateManifest(layers []v1.Descriptor, ociCompat api.OCIVersion) ([]Pusha case api.OCIVersion1_1: config = v1.DescriptorEmptyJSON artifactType = ComposeProjectArtifactType - config.ArtifactType = artifactType // N.B. the descriptor has the data embedded in it toPush = append(toPush, Pushable{Descriptor: config, Data: make([]byte, len(config.Data))}) default: