Skip to content

Commit 0ab21a2

Browse files
authored
Merge pull request docker#11211 from ndeloof/Services
avoir use of []types.ServiceConfig
2 parents f557220 + 5e77ae9 commit 0ab21a2

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

cmd/compose/compose_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
func TestFilterServices(t *testing.T) {
2727
p := &types.Project{
28-
Services: []types.ServiceConfig{
28+
Services: types.Services{
2929
{
3030
Name: "foo",
3131
Links: []string{"bar"},

cmd/compose/options_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
func TestApplyPlatforms_InferFromRuntime(t *testing.T) {
2727
makeProject := func() *types.Project {
2828
return &types.Project{
29-
Services: []types.ServiceConfig{
29+
Services: types.Services{
3030
{
3131
Name: "test",
3232
Image: "foo",
@@ -64,7 +64,7 @@ func TestApplyPlatforms_DockerDefaultPlatform(t *testing.T) {
6464
Environment: map[string]string{
6565
"DOCKER_DEFAULT_PLATFORM": "linux/amd64",
6666
},
67-
Services: []types.ServiceConfig{
67+
Services: types.Services{
6868
{
6969
Name: "test",
7070
Image: "foo",
@@ -100,7 +100,7 @@ func TestApplyPlatforms_UnsupportedPlatform(t *testing.T) {
100100
Environment: map[string]string{
101101
"DOCKER_DEFAULT_PLATFORM": "commodore/64",
102102
},
103-
Services: []types.ServiceConfig{
103+
Services: types.Services{
104104
{
105105
Name: "test",
106106
Image: "foo",

cmd/compose/pullOptions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
func TestApplyPullOptions(t *testing.T) {
2727
project := &types.Project{
28-
Services: []types.ServiceConfig{
28+
Services: types.Services{
2929
{
3030
Name: "must-build",
3131
// No image, local build only

cmd/compose/up_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
func TestApplyScaleOpt(t *testing.T) {
2727
p := types.Project{
28-
Services: []types.ServiceConfig{
28+
Services: types.Services{
2929
{
3030
Name: "foo",
3131
},

pkg/compose/convergence_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func TestWaitDependencies(t *testing.T) {
224224
t.Run("should skip dependencies with scale 0", func(t *testing.T) {
225225
dbService := types.ServiceConfig{Name: "db", Scale: 0}
226226
redisService := types.ServiceConfig{Name: "redis", Scale: 0}
227-
project := types.Project{Name: strings.ToLower(testProject), Services: []types.ServiceConfig{dbService, redisService}}
227+
project := types.Project{Name: strings.ToLower(testProject), Services: types.Services{dbService, redisService}}
228228
dependencies := types.DependsOnConfig{
229229
"db": {Condition: ServiceConditionRunningOrHealthy},
230230
"redis": {Condition: ServiceConditionRunningOrHealthy},
@@ -234,7 +234,7 @@ func TestWaitDependencies(t *testing.T) {
234234
t.Run("should skip dependencies with condition service_started", func(t *testing.T) {
235235
dbService := types.ServiceConfig{Name: "db", Scale: 1}
236236
redisService := types.ServiceConfig{Name: "redis", Scale: 1}
237-
project := types.Project{Name: strings.ToLower(testProject), Services: []types.ServiceConfig{dbService, redisService}}
237+
project := types.Project{Name: strings.ToLower(testProject), Services: types.Services{dbService, redisService}}
238238
dependencies := types.DependsOnConfig{
239239
"db": {Condition: types.ServiceConditionStarted, Required: true},
240240
"redis": {Condition: types.ServiceConditionStarted, Required: true},

pkg/compose/dependencies_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
func createTestProject() *types.Project {
3434
return &types.Project{
35-
Services: []types.ServiceConfig{
35+
Services: types.Services{
3636
{
3737
Name: "test1",
3838
DependsOn: map[string]types.ServiceDependency{
@@ -59,7 +59,7 @@ func TestTraversalWithMultipleParents(t *testing.T) {
5959
}
6060

6161
project := types.Project{
62-
Services: []types.ServiceConfig{dependent},
62+
Services: types.Services{dependent},
6363
}
6464

6565
for i := 1; i <= 100; i++ {

pkg/compose/pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func encodedAuth(ref reference.Named, configFile driver.Auth) (string, error) {
260260
}
261261

262262
func (s *composeService) pullRequiredImages(ctx context.Context, project *types.Project, images map[string]string, quietPull bool) error {
263-
var needPull []types.ServiceConfig
263+
var needPull types.Services
264264
for _, service := range project.Services {
265265
if service.Image == "" {
266266
continue
@@ -308,7 +308,7 @@ func (s *composeService) pullRequiredImages(ctx context.Context, project *types.
308308
}, s.stdinfo())
309309
}
310310

311-
func isServiceImageToBuild(service types.ServiceConfig, services []types.ServiceConfig) bool {
311+
func isServiceImageToBuild(service types.ServiceConfig, services types.Services) bool {
312312
if service.Build != nil {
313313
return true
314314
}

pkg/compose/viz_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestViz(t *testing.T) {
3333
project := types.Project{
3434
Name: "viz-test",
3535
WorkingDir: "/home",
36-
Services: []types.ServiceConfig{
36+
Services: types.Services{
3737
{
3838
Name: "service1",
3939
Image: "image-for-service1",

pkg/compose/watch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func TestWatch_Sync(t *testing.T) {
105105
t.Cleanup(cancelFunc)
106106

107107
proj := types.Project{
108-
Services: []types.ServiceConfig{
108+
Services: types.Services{
109109
{
110110
Name: "test",
111111
},

0 commit comments

Comments
 (0)