Skip to content

Commit b5fa00b

Browse files
committed
Remove version: from test compose yaml files
Signed-off-by: apostasie <[email protected]>
1 parent 2a2834d commit b5fa00b

9 files changed

+0
-57
lines changed

cmd/nerdctl/compose/compose_cp_linux_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ import (
3131

3232
func TestComposeCopy(t *testing.T) {
3333
var dockerComposeYAML = fmt.Sprintf(`
34-
version: '3.1'
35-
3634
services:
3735
svc0:
3836
image: %s

cmd/nerdctl/compose/compose_down_linux_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ func TestComposeDownRemoveUsedNetwork(t *testing.T) {
3030

3131
var (
3232
dockerComposeYAMLOrphan = fmt.Sprintf(`
33-
version: '3.1'
34-
3533
services:
3634
test:
3735
image: %s
@@ -66,8 +64,6 @@ func TestComposeDownRemoveOrphans(t *testing.T) {
6664

6765
var (
6866
dockerComposeYAMLOrphan = fmt.Sprintf(`
69-
version: '3.1'
70-
7167
services:
7268
test:
7369
image: %s

cmd/nerdctl/compose/compose_exec_linux_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ import (
3434

3535
func TestComposeExec(t *testing.T) {
3636
dockerComposeYAML := fmt.Sprintf(`
37-
version: '3.1'
38-
3937
services:
4038
svc0:
4139
image: %s
@@ -179,8 +177,6 @@ services:
179177
func TestComposeExecTTY(t *testing.T) {
180178
const expectedOutput = "speed 38400 baud"
181179
dockerComposeYAML := fmt.Sprintf(`
182-
version: '3.1'
183-
184180
services:
185181
svc0:
186182
image: %s
@@ -267,8 +263,6 @@ services:
267263

268264
func TestComposeExecWithIndex(t *testing.T) {
269265
dockerComposeYAML := fmt.Sprintf(`
270-
version: '3.1'
271-
272266
services:
273267
svc0:
274268
image: %s

cmd/nerdctl/compose/compose_kill_linux_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import (
2727
func TestComposeKill(t *testing.T) {
2828
base := testutil.NewBase(t)
2929
var dockerComposeYAML = fmt.Sprintf(`
30-
version: '3.1'
31-
3230
services:
3331
3432
wordpress:

cmd/nerdctl/compose/compose_pause_linux_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ func TestComposePauseAndUnpause(t *testing.T) {
3131
}
3232

3333
var dockerComposeYAML = fmt.Sprintf(`
34-
version: '3.1'
35-
3634
services:
3735
svc0:
3836
image: %s

cmd/nerdctl/compose/compose_port_linux_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ func TestComposePort(t *testing.T) {
2727
base := testutil.NewBase(t)
2828

2929
var dockerComposeYAML = fmt.Sprintf(`
30-
version: '3.1'
31-
3230
services:
3331
svc0:
3432
image: %s
@@ -55,8 +53,6 @@ func TestComposePortFailure(t *testing.T) {
5553
base := testutil.NewBase(t)
5654

5755
var dockerComposeYAML = fmt.Sprintf(`
58-
version: '3.1'
59-
6056
services:
6157
svc0:
6258
image: %s

cmd/nerdctl/compose/compose_ps_linux_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ import (
3232
func TestComposePs(t *testing.T) {
3333
base := testutil.NewBase(t)
3434
var dockerComposeYAML = fmt.Sprintf(`
35-
version: '3.1'
36-
3735
services:
3836
wordpress:
3937
image: %s
@@ -112,8 +110,6 @@ func TestComposePsJSON(t *testing.T) {
112110

113111
base := testutil.NewBase(t)
114112
var dockerComposeYAML = fmt.Sprintf(`
115-
version: '3.1'
116-
117113
services:
118114
wordpress:
119115
image: %s

cmd/nerdctl/compose/compose_run_linux_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func TestComposeRun(t *testing.T) {
4040
const expectedOutput = "speed 38400 baud"
4141

4242
dockerComposeYAML := fmt.Sprintf(`
43-
version: '3.1'
4443
services:
4544
alpine:
4645
image: %s
@@ -120,7 +119,6 @@ func TestComposeRunWithServicePorts(t *testing.T) {
120119
containerName := testutil.Identifier(t)
121120

122121
dockerComposeYAML := fmt.Sprintf(`
123-
version: '3.1'
124122
services:
125123
web:
126124
image: %s
@@ -182,7 +180,6 @@ func TestComposeRunWithPublish(t *testing.T) {
182180
containerName := testutil.Identifier(t)
183181

184182
dockerComposeYAML := fmt.Sprintf(`
185-
version: '3.1'
186183
services:
187184
web:
188185
image: %s
@@ -242,7 +239,6 @@ func TestComposeRunWithEnv(t *testing.T) {
242239
containerName := testutil.Identifier(t)
243240

244241
dockerComposeYAML := fmt.Sprintf(`
245-
version: '3.1'
246242
services:
247243
alpine:
248244
image: %s
@@ -274,7 +270,6 @@ func TestComposeRunWithUser(t *testing.T) {
274270
containerName := testutil.Identifier(t)
275271

276272
dockerComposeYAML := fmt.Sprintf(`
277-
version: '3.1'
278273
services:
279274
alpine:
280275
image: %s
@@ -303,7 +298,6 @@ func TestComposeRunWithLabel(t *testing.T) {
303298
containerName := testutil.Identifier(t)
304299

305300
dockerComposeYAML := fmt.Sprintf(`
306-
version: '3.1'
307301
services:
308302
alpine:
309303
image: %s
@@ -341,7 +335,6 @@ func TestComposeRunWithArgs(t *testing.T) {
341335
containerName := testutil.Identifier(t)
342336

343337
dockerComposeYAML := fmt.Sprintf(`
344-
version: '3.1'
345338
services:
346339
alpine:
347340
image: %s
@@ -371,7 +364,6 @@ func TestComposeRunWithEntrypoint(t *testing.T) {
371364
containerName := testutil.Identifier(t)
372365

373366
dockerComposeYAML := fmt.Sprintf(`
374-
version: '3.1'
375367
services:
376368
alpine:
377369
image: %s
@@ -399,7 +391,6 @@ func TestComposeRunWithVolume(t *testing.T) {
399391
containerName := testutil.Identifier(t)
400392

401393
dockerComposeYAML := fmt.Sprintf(`
402-
version: '3.1'
403394
services:
404395
alpine:
405396
image: %s

cmd/nerdctl/compose/compose_up_linux_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ import (
4040
func TestComposeUp(t *testing.T) {
4141
base := testutil.NewBase(t)
4242
helpers.ComposeUp(t, base, fmt.Sprintf(`
43-
version: '3.1'
44-
4543
services:
4644
4745
wordpress:
@@ -117,8 +115,6 @@ func TestComposeUpNetWithStaticIP(t *testing.T) {
117115
base := testutil.NewBase(t)
118116
staticIP := "172.20.0.12"
119117
var dockerComposeYAML = fmt.Sprintf(`
120-
version: '3.1'
121-
122118
services:
123119
svc0:
124120
image: %s
@@ -155,8 +151,6 @@ func TestComposeUpMultiNet(t *testing.T) {
155151
base := testutil.NewBase(t)
156152

157153
var dockerComposeYAML = fmt.Sprintf(`
158-
version: '3.1'
159-
160154
services:
161155
svc0:
162156
image: %s
@@ -204,8 +198,6 @@ func TestComposeUpOsEnvVar(t *testing.T) {
204198
base := testutil.NewBase(t)
205199
const containerName = "nginxAlpine"
206200
var dockerComposeYAML = fmt.Sprintf(`
207-
version: '3.1'
208-
209201
services:
210202
svc1:
211203
image: %s
@@ -237,8 +229,6 @@ func TestComposeUpDotEnvFile(t *testing.T) {
237229
base := testutil.NewBase(t)
238230

239231
var dockerComposeYAML = `
240-
version: '3.1'
241-
242232
services:
243233
svc3:
244234
image: ghcr.io/stargz-containers/nginx:$TAG
@@ -260,8 +250,6 @@ func TestComposeUpEnvFileNotFoundError(t *testing.T) {
260250
base := testutil.NewBase(t)
261251

262252
var dockerComposeYAML = `
263-
version: '3.1'
264-
265253
services:
266254
svc4:
267255
image: ghcr.io/stargz-containers/nginx:$TAG
@@ -284,8 +272,6 @@ func TestComposeUpWithScale(t *testing.T) {
284272
base := testutil.NewBase(t)
285273

286274
var dockerComposeYAML = fmt.Sprintf(`
287-
version: '3.1'
288-
289275
services:
290276
test:
291277
image: %s
@@ -307,8 +293,6 @@ func TestComposeIPAMConfig(t *testing.T) {
307293
base := testutil.NewBase(t)
308294

309295
var dockerComposeYAML = fmt.Sprintf(`
310-
version: '3.1'
311-
312296
services:
313297
foo:
314298
image: %s
@@ -337,8 +321,6 @@ func TestComposeUpRemoveOrphans(t *testing.T) {
337321

338322
var (
339323
dockerComposeYAMLOrphan = fmt.Sprintf(`
340-
version: '3.1'
341-
342324
services:
343325
test:
344326
image: %s
@@ -375,8 +357,6 @@ func TestComposeUpIdempotent(t *testing.T) {
375357
base := testutil.NewBase(t)
376358

377359
var dockerComposeYAML = fmt.Sprintf(`
378-
version: '3.1'
379-
380360
services:
381361
test:
382362
image: %s
@@ -399,7 +379,6 @@ func TestComposeUpWithExternalNetwork(t *testing.T) {
399379
containerName2 := testutil.Identifier(t) + "-2"
400380
networkName := testutil.Identifier(t) + "-network"
401381
var dockerComposeYaml1 = fmt.Sprintf(`
402-
version: "3"
403382
services:
404383
%s:
405384
image: %s
@@ -413,7 +392,6 @@ networks:
413392
external: true
414393
`, containerName1, testutil.NginxAlpineImage, containerName1, networkName, networkName)
415394
var dockerComposeYaml2 = fmt.Sprintf(`
416-
version: "3"
417395
services:
418396
%s:
419397
image: %s
@@ -457,8 +435,6 @@ func TestComposeUpWithBypass4netns(t *testing.T) {
457435
testutil.RequireSystemService(t, "bypass4netnsd")
458436
base := testutil.NewBase(t)
459437
helpers.ComposeUp(t, base, fmt.Sprintf(`
460-
version: '3.1'
461-
462438
services:
463439
464440
wordpress:

0 commit comments

Comments
 (0)