mirror of
https://github.com/docker/compose.git
synced 2026-02-15 21:19:30 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a000978980 | ||
|
|
361c0893a9 | ||
|
|
513b6128c2 | ||
|
|
eececb9add | ||
|
|
501b5acde6 | ||
|
|
f51bc4cd00 |
@@ -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"
|
||||
|
||||
2
go.mod
2
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.1
|
||||
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
|
||||
|
||||
4
go.sum
4
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.1 h1:tEg6Qn/9LZnKg42fZlFmxN4lxSqnCvsiG5TXnxzvI4c=
|
||||
github.com/compose-spec/compose-go/v2 v2.4.1/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=
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
15
pkg/e2e/fixtures/profiles/docker-compose.yaml
Normal file
15
pkg/e2e/fixtures/profiles/docker-compose.yaml
Normal file
@@ -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
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user