@@ -290,6 +290,99 @@ func (d *DryRunClient) WithAPIClient(apiClient client.APIClient) {
290
290
d .CheckpointListFn = apiClient .CheckpointList
291
291
}
292
292
293
+ // All methods and functions which need to be overridden for dry run.
294
+
295
+ func (d * DryRunClient ) ContainerAttach (ctx context.Context , container string , options moby.ContainerAttachOptions ) (moby.HijackedResponse , error ) {
296
+ return moby.HijackedResponse {}, ErrNotImplemented
297
+ }
298
+
299
+ func (d * DryRunClient ) ContainerCreate (ctx context.Context , config * containerType.Config , hostConfig * containerType.HostConfig ,
300
+ networkingConfig * network.NetworkingConfig , platform * specs.Platform , containerName string ) (containerType.CreateResponse , error ) {
301
+ return containerType.CreateResponse {}, ErrNotImplemented
302
+ }
303
+
304
+ func (d * DryRunClient ) ContainerKill (ctx context.Context , container , signal string ) error {
305
+ return ErrNotImplemented
306
+ }
307
+
308
+ func (d * DryRunClient ) ContainerPause (ctx context.Context , container string ) error {
309
+ return ErrNotImplemented
310
+ }
311
+
312
+ func (d * DryRunClient ) ContainerRemove (ctx context.Context , container string , options moby.ContainerRemoveOptions ) error {
313
+ return ErrNotImplemented
314
+ }
315
+
316
+ func (d * DryRunClient ) ContainerRename (ctx context.Context , container , newContainerName string ) error {
317
+ return ErrNotImplemented
318
+ }
319
+
320
+ func (d * DryRunClient ) ContainerRestart (ctx context.Context , container string , options containerType.StopOptions ) error {
321
+ return ErrNotImplemented
322
+ }
323
+
324
+ func (d * DryRunClient ) ContainerStart (ctx context.Context , container string , options moby.ContainerStartOptions ) error {
325
+ return ErrNotImplemented
326
+ }
327
+
328
+ func (d * DryRunClient ) ContainerStop (ctx context.Context , container string , options containerType.StopOptions ) error {
329
+ return ErrNotImplemented
330
+ }
331
+
332
+ func (d * DryRunClient ) ContainerUnpause (ctx context.Context , container string ) error {
333
+ return ErrNotImplemented
334
+ }
335
+
336
+ func (d * DryRunClient ) CopyFromContainer (ctx context.Context , container , srcPath string ) (io.ReadCloser , moby.ContainerPathStat , error ) {
337
+ return nil , moby.ContainerPathStat {}, ErrNotImplemented
338
+ }
339
+
340
+ func (d * DryRunClient ) CopyToContainer (ctx context.Context , container , path string , content io.Reader , options moby.CopyToContainerOptions ) error {
341
+ return ErrNotImplemented
342
+ }
343
+
344
+ func (d * DryRunClient ) ImageBuild (ctx context.Context , reader io.Reader , options moby.ImageBuildOptions ) (moby.ImageBuildResponse , error ) {
345
+ return moby.ImageBuildResponse {}, ErrNotImplemented
346
+ }
347
+
348
+ func (d * DryRunClient ) ImagePull (ctx context.Context , ref string , options moby.ImagePullOptions ) (io.ReadCloser , error ) {
349
+ return nil , ErrNotImplemented
350
+ }
351
+
352
+ func (d * DryRunClient ) ImagePush (ctx context.Context , ref string , options moby.ImagePushOptions ) (io.ReadCloser , error ) {
353
+ return nil , ErrNotImplemented
354
+ }
355
+
356
+ func (d * DryRunClient ) ImageRemove (ctx context.Context , imageName string , options moby.ImageRemoveOptions ) ([]moby.ImageDeleteResponseItem , error ) {
357
+ return nil , ErrNotImplemented
358
+ }
359
+
360
+ func (d * DryRunClient ) NetworkConnect (ctx context.Context , networkName , container string , config * network.EndpointSettings ) error {
361
+ return ErrNotImplemented
362
+ }
363
+
364
+ func (d * DryRunClient ) NetworkCreate (ctx context.Context , name string , options moby.NetworkCreate ) (moby.NetworkCreateResponse , error ) {
365
+ return moby.NetworkCreateResponse {}, ErrNotImplemented
366
+ }
367
+
368
+ func (d * DryRunClient ) NetworkDisconnect (ctx context.Context , networkName , container string , force bool ) error {
369
+ return ErrNotImplemented
370
+ }
371
+
372
+ func (d * DryRunClient ) NetworkRemove (ctx context.Context , networkName string ) error {
373
+ return ErrNotImplemented
374
+ }
375
+
376
+ func (d * DryRunClient ) VolumeCreate (ctx context.Context , options volume.CreateOptions ) (volume.Volume , error ) {
377
+ return volume.Volume {}, ErrNotImplemented
378
+ }
379
+
380
+ func (d * DryRunClient ) VolumeRemove (ctx context.Context , volumeID string , force bool ) error {
381
+ return ErrNotImplemented
382
+ }
383
+
384
+ // Functions delegated to original APIClient (not used by Compose or not modifying the Compose stack
385
+
293
386
func (d * DryRunClient ) ConfigList (ctx context.Context , options moby.ConfigListOptions ) ([]swarm.Config , error ) {
294
387
if d .ConfigListFn == nil {
295
388
return nil , ErrNotImplemented
@@ -325,28 +418,13 @@ func (d *DryRunClient) ConfigUpdate(ctx context.Context, id string, version swar
325
418
return d .ConfigUpdateFn (ctx , id , version , config )
326
419
}
327
420
328
- func (d * DryRunClient ) ContainerAttach (ctx context.Context , container string , options moby.ContainerAttachOptions ) (moby.HijackedResponse , error ) {
329
- if d .ContainerAttachFn == nil {
330
- return moby.HijackedResponse {}, ErrNotImplemented
331
- }
332
- return d .ContainerAttachFn (ctx , container , options )
333
- }
334
-
335
421
func (d * DryRunClient ) ContainerCommit (ctx context.Context , container string , options moby.ContainerCommitOptions ) (moby.IDResponse , error ) {
336
422
if d .ContainerCommitFn == nil {
337
423
return moby.IDResponse {}, ErrNotImplemented
338
424
}
339
425
return d .ContainerCommitFn (ctx , container , options )
340
426
}
341
427
342
- func (d * DryRunClient ) ContainerCreate (ctx context.Context , config * containerType.Config , hostConfig * containerType.HostConfig ,
343
- networkingConfig * network.NetworkingConfig , platform * specs.Platform , containerName string ) (containerType.CreateResponse , error ) {
344
- if d .ContainerCreateFn == nil {
345
- return containerType.CreateResponse {}, ErrNotImplemented
346
- }
347
- return d .ContainerCreateFn (ctx , config , hostConfig , networkingConfig , platform , containerName )
348
- }
349
-
350
428
func (d * DryRunClient ) ContainerDiff (ctx context.Context , container string ) ([]containerType.ContainerChangeResponseItem , error ) {
351
429
if d .ContainerDiffFn == nil {
352
430
return nil , ErrNotImplemented
@@ -410,13 +488,6 @@ func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container st
410
488
return d .ContainerInspectWithRawFn (ctx , container , getSize )
411
489
}
412
490
413
- func (d * DryRunClient ) ContainerKill (ctx context.Context , container , signal string ) error {
414
- if d .ContainerKillFn == nil {
415
- return ErrNotImplemented
416
- }
417
- return d .ContainerKillFn (ctx , container , signal )
418
- }
419
-
420
491
func (d * DryRunClient ) ContainerList (ctx context.Context , options moby.ContainerListOptions ) ([]moby.Container , error ) {
421
492
if d .ContainerListFn == nil {
422
493
return nil , ErrNotImplemented
@@ -431,41 +502,13 @@ func (d *DryRunClient) ContainerLogs(ctx context.Context, container string, opti
431
502
return d .ContainerLogsFn (ctx , container , options )
432
503
}
433
504
434
- func (d * DryRunClient ) ContainerPause (ctx context.Context , container string ) error {
435
- if d .ContainerPauseFn == nil {
436
- return ErrNotImplemented
437
- }
438
- return d .ContainerPauseFn (ctx , container )
439
- }
440
-
441
- func (d * DryRunClient ) ContainerRemove (ctx context.Context , container string , options moby.ContainerRemoveOptions ) error {
442
- if d .ContainerRemoveFn == nil {
443
- return ErrNotImplemented
444
- }
445
- return d .ContainerRemoveFn (ctx , container , options )
446
- }
447
-
448
- func (d * DryRunClient ) ContainerRename (ctx context.Context , container , newContainerName string ) error {
449
- if d .ContainerRenameFn == nil {
450
- return ErrNotImplemented
451
- }
452
- return d .ContainerRenameFn (ctx , container , newContainerName )
453
- }
454
-
455
505
func (d * DryRunClient ) ContainerResize (ctx context.Context , container string , options moby.ResizeOptions ) error {
456
506
if d .ContainerResizeFn == nil {
457
507
return ErrNotImplemented
458
508
}
459
509
return d .ContainerResizeFn (ctx , container , options )
460
510
}
461
511
462
- func (d * DryRunClient ) ContainerRestart (ctx context.Context , container string , options containerType.StopOptions ) error {
463
- if d .ContainerRestartFn == nil {
464
- return ErrNotImplemented
465
- }
466
- return d .ContainerRestartFn (ctx , container , options )
467
- }
468
-
469
512
func (d * DryRunClient ) ContainerStatPath (ctx context.Context , container , path string ) (moby.ContainerPathStat , error ) {
470
513
if d .ContainerStatPathFn == nil {
471
514
return moby.ContainerPathStat {}, ErrNotImplemented
@@ -487,34 +530,13 @@ func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container stri
487
530
return d .ContainerStatsOneShotFn (ctx , container )
488
531
}
489
532
490
- func (d * DryRunClient ) ContainerStart (ctx context.Context , container string , options moby.ContainerStartOptions ) error {
491
- if d .ContainerStartFn == nil {
492
- return ErrNotImplemented
493
- }
494
- return d .ContainerStartFn (ctx , container , options )
495
- }
496
-
497
- func (d * DryRunClient ) ContainerStop (ctx context.Context , container string , options containerType.StopOptions ) error {
498
- if d .ContainerStopFn == nil {
499
- return ErrNotImplemented
500
- }
501
- return d .ContainerStopFn (ctx , container , options )
502
- }
503
-
504
533
func (d * DryRunClient ) ContainerTop (ctx context.Context , container string , arguments []string ) (containerType.ContainerTopOKBody , error ) {
505
534
if d .ContainerTopFn == nil {
506
535
return containerType.ContainerTopOKBody {}, ErrNotImplemented
507
536
}
508
537
return d .ContainerTopFn (ctx , container , arguments )
509
538
}
510
539
511
- func (d * DryRunClient ) ContainerUnpause (ctx context.Context , container string ) error {
512
- if d .ContainerUnpauseFn == nil {
513
- return ErrNotImplemented
514
- }
515
- return d .ContainerUnpauseFn (ctx , container )
516
- }
517
-
518
540
func (d * DryRunClient ) ContainerUpdate (ctx context.Context , container string , updateConfig containerType.UpdateConfig ) (containerType.ContainerUpdateOKBody , error ) {
519
541
if d .ContainerUpdateFn == nil {
520
542
return containerType.ContainerUpdateOKBody {}, ErrNotImplemented
@@ -531,20 +553,6 @@ func (d *DryRunClient) ContainerWait(ctx context.Context, container string, cond
531
553
return d .ContainerWaitFn (ctx , container , condition )
532
554
}
533
555
534
- func (d * DryRunClient ) CopyFromContainer (ctx context.Context , container , srcPath string ) (io.ReadCloser , moby.ContainerPathStat , error ) {
535
- if d .CopyFromContainerFn == nil {
536
- return nil , moby.ContainerPathStat {}, ErrNotImplemented
537
- }
538
- return d .CopyFromContainerFn (ctx , container , srcPath )
539
- }
540
-
541
- func (d * DryRunClient ) CopyToContainer (ctx context.Context , container , path string , content io.Reader , options moby.CopyToContainerOptions ) error {
542
- if d .CopyToContainerFn == nil {
543
- return ErrNotImplemented
544
- }
545
- return d .CopyToContainerFn (ctx , container , path , content , options )
546
- }
547
-
548
556
func (d * DryRunClient ) ContainersPrune (ctx context.Context , pruneFilters filters.Args ) (moby.ContainersPruneReport , error ) {
549
557
if d .ContainersPruneFn == nil {
550
558
return moby.ContainersPruneReport {}, ErrNotImplemented
@@ -559,13 +567,6 @@ func (d *DryRunClient) DistributionInspect(ctx context.Context, imageName, encod
559
567
return d .DistributionInspectFn (ctx , imageName , encodedRegistryAuth )
560
568
}
561
569
562
- func (d * DryRunClient ) ImageBuild (ctx context.Context , reader io.Reader , options moby.ImageBuildOptions ) (moby.ImageBuildResponse , error ) {
563
- if d .ImageBuildFn == nil {
564
- return moby.ImageBuildResponse {}, ErrNotImplemented
565
- }
566
- return d .ImageBuildFn (ctx , reader , options )
567
- }
568
-
569
570
func (d * DryRunClient ) BuildCachePrune (ctx context.Context , opts moby.BuildCachePruneOptions ) (* moby.BuildCachePruneReport , error ) {
570
571
if d .BuildCachePruneFn == nil {
571
572
return nil , ErrNotImplemented
@@ -622,27 +623,6 @@ func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, quiet boo
622
623
return d .ImageLoadFn (ctx , input , quiet )
623
624
}
624
625
625
- func (d * DryRunClient ) ImagePull (ctx context.Context , ref string , options moby.ImagePullOptions ) (io.ReadCloser , error ) {
626
- if d .ImagePullFn == nil {
627
- return nil , ErrNotImplemented
628
- }
629
- return d .ImagePullFn (ctx , ref , options )
630
- }
631
-
632
- func (d * DryRunClient ) ImagePush (ctx context.Context , ref string , options moby.ImagePushOptions ) (io.ReadCloser , error ) {
633
- if d .ImagePushFn == nil {
634
- return nil , ErrNotImplemented
635
- }
636
- return d .ImagePushFn (ctx , ref , options )
637
- }
638
-
639
- func (d * DryRunClient ) ImageRemove (ctx context.Context , imageName string , options moby.ImageRemoveOptions ) ([]moby.ImageDeleteResponseItem , error ) {
640
- if d .ImageRemoveFn == nil {
641
- return nil , ErrNotImplemented
642
- }
643
- return d .ImageRemoveFn (ctx , imageName , options )
644
- }
645
-
646
626
func (d * DryRunClient ) ImageSearch (ctx context.Context , term string , options moby.ImageSearchOptions ) ([]registry.SearchResult , error ) {
647
627
if d .ImageSearchFn == nil {
648
628
return nil , ErrNotImplemented
@@ -699,27 +679,6 @@ func (d *DryRunClient) NodeUpdate(ctx context.Context, nodeID string, version sw
699
679
return d .NodeUpdateFn (ctx , nodeID , version , node )
700
680
}
701
681
702
- func (d * DryRunClient ) NetworkConnect (ctx context.Context , networkName , container string , config * network.EndpointSettings ) error {
703
- if d .NetworkConnectFn == nil {
704
- return ErrNotImplemented
705
- }
706
- return d .NetworkConnectFn (ctx , networkName , container , config )
707
- }
708
-
709
- func (d * DryRunClient ) NetworkCreate (ctx context.Context , name string , options moby.NetworkCreate ) (moby.NetworkCreateResponse , error ) {
710
- if d .NetworkCreateFn == nil {
711
- return moby.NetworkCreateResponse {}, ErrNotImplemented
712
- }
713
- return d .NetworkCreateFn (ctx , name , options )
714
- }
715
-
716
- func (d * DryRunClient ) NetworkDisconnect (ctx context.Context , networkName , container string , force bool ) error {
717
- if d .NetworkDisconnectFn == nil {
718
- return ErrNotImplemented
719
- }
720
- return d .NetworkDisconnectFn (ctx , networkName , container , force )
721
- }
722
-
723
682
func (d * DryRunClient ) NetworkInspect (ctx context.Context , networkName string , options moby.NetworkInspectOptions ) (moby.NetworkResource , error ) {
724
683
if d .NetworkInspectFn == nil {
725
684
return moby.NetworkResource {}, ErrNotImplemented
@@ -741,10 +700,6 @@ func (d *DryRunClient) NetworkList(ctx context.Context, options moby.NetworkList
741
700
return d .NetworkListFn (ctx , options )
742
701
}
743
702
744
- func (d * DryRunClient ) NetworkRemove (ctx context.Context , networkName string ) error {
745
- return d .NetworkRemoveFn (ctx , networkName )
746
- }
747
-
748
703
func (d * DryRunClient ) NetworksPrune (ctx context.Context , pruneFilter filters.Args ) (moby.NetworksPruneReport , error ) {
749
704
if d .NetworksPruneFn == nil {
750
705
return moby.NetworksPruneReport {}, ErrNotImplemented
@@ -1006,13 +961,6 @@ func (d *DryRunClient) Ping(ctx context.Context) (moby.Ping, error) {
1006
961
return d .PingFn (ctx )
1007
962
}
1008
963
1009
- func (d * DryRunClient ) VolumeCreate (ctx context.Context , options volume.CreateOptions ) (volume.Volume , error ) {
1010
- if d .VolumeCreateFn == nil {
1011
- return volume.Volume {}, ErrNotImplemented
1012
- }
1013
- return d .VolumeCreateFn (ctx , options )
1014
- }
1015
-
1016
964
func (d * DryRunClient ) VolumeInspect (ctx context.Context , volumeID string ) (volume.Volume , error ) {
1017
965
if d .VolumeInspectFn == nil {
1018
966
return volume.Volume {}, ErrNotImplemented
@@ -1034,13 +982,6 @@ func (d *DryRunClient) VolumeList(ctx context.Context, filter filters.Args) (vol
1034
982
return d .VolumeListFn (ctx , filter )
1035
983
}
1036
984
1037
- func (d * DryRunClient ) VolumeRemove (ctx context.Context , volumeID string , force bool ) error {
1038
- if d .VolumeRemoveFn == nil {
1039
- return ErrNotImplemented
1040
- }
1041
- return d .VolumeRemoveFn (ctx , volumeID , force )
1042
- }
1043
-
1044
985
func (d * DryRunClient ) VolumesPrune (ctx context.Context , pruneFilter filters.Args ) (moby.VolumesPruneReport , error ) {
1045
986
if d .VolumesPruneFn == nil {
1046
987
return moby.VolumesPruneReport {}, ErrNotImplemented
0 commit comments