@@ -5,22 +5,16 @@ import (
55 "io"
66
77 "github.com/moby/moby/api/types/container"
8- "github.com/moby/moby/api/types/network"
98 "github.com/moby/moby/api/types/system"
109 "github.com/moby/moby/client"
11- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
1210)
1311
1412type fakeClient struct {
1513 client.Client
16- inspectFunc func (string ) (container.InspectResponse , error )
17- execInspectFunc func (execID string ) (client.ExecInspectResult , error )
18- execCreateFunc func (containerID string , options client.ExecCreateOptions ) (client.ExecCreateResult , error )
19- createContainerFunc func (config * container.Config ,
20- hostConfig * container.HostConfig ,
21- networkingConfig * network.NetworkingConfig ,
22- platform * ocispec.Platform ,
23- containerName string ) (container.CreateResponse , error )
14+ inspectFunc func (string ) (container.InspectResponse , error )
15+ execInspectFunc func (execID string ) (client.ExecInspectResult , error )
16+ execCreateFunc func (containerID string , options client.ExecCreateOptions ) (client.ExecCreateResult , error )
17+ createContainerFunc func (options client.ContainerCreateOptions ) (client.ContainerCreateResult , error )
2418 containerStartFunc func (containerID string , options client.ContainerStartOptions ) error
2519 imageCreateFunc func (ctx context.Context , parentReference string , options client.ImageCreateOptions ) (client.ImageCreateResult , error )
2620 infoFunc func () (system.Info , error )
@@ -36,10 +30,10 @@ type fakeClient struct {
3630 containerStopFunc func (ctx context.Context , containerID string , options client.ContainerStopOptions ) error
3731 containerKillFunc func (ctx context.Context , containerID , signal string ) error
3832 containerPruneFunc func (ctx context.Context , options client.ContainerPruneOptions ) (client.ContainerPruneResult , error )
39- containerAttachFunc func (ctx context.Context , containerID string , options client.ContainerAttachOptions ) (client.HijackedResponse , error )
40- containerDiffFunc func (ctx context.Context , containerID string ) ([]container. FilesystemChange , error )
33+ containerAttachFunc func (ctx context.Context , containerID string , options client.ContainerAttachOptions ) (client.ContainerAttachResult , error )
34+ containerDiffFunc func (ctx context.Context , containerID string ) (client. ContainerDiffResult , error )
4135 containerRenameFunc func (ctx context.Context , oldName , newName string ) error
42- containerCommitFunc func (ctx context.Context , container string , options client.ContainerCommitOptions ) (container. CommitResponse , error )
36+ containerCommitFunc func (ctx context.Context , container string , options client.ContainerCommitOptions ) (client. ContainerCommitResult , error )
4337 containerPauseFunc func (ctx context.Context , container string ) error
4438 Version string
4539}
@@ -76,18 +70,11 @@ func (*fakeClient) ExecStart(context.Context, string, client.ExecStartOptions) (
7670 return client.ExecStartResult {}, nil
7771}
7872
79- func (f * fakeClient ) ContainerCreate (
80- _ context.Context ,
81- config * container.Config ,
82- hostConfig * container.HostConfig ,
83- networkingConfig * network.NetworkingConfig ,
84- platform * ocispec.Platform ,
85- containerName string ,
86- ) (container.CreateResponse , error ) {
73+ func (f * fakeClient ) ContainerCreate (_ context.Context , options client.ContainerCreateOptions ) (client.ContainerCreateResult , error ) {
8774 if f .createContainerFunc != nil {
88- return f .createContainerFunc (config , hostConfig , networkingConfig , platform , containerName )
75+ return f .createContainerFunc (options )
8976 }
90- return container. CreateResponse {}, nil
77+ return client. ContainerCreateResult {}, nil
9178}
9279
9380func (f * fakeClient ) ContainerRemove (ctx context.Context , containerID string , options client.ContainerRemoveOptions ) error {
@@ -192,19 +179,19 @@ func (f *fakeClient) ContainerStop(ctx context.Context, containerID string, opti
192179 return nil
193180}
194181
195- func (f * fakeClient ) ContainerAttach (ctx context.Context , containerID string , options client.ContainerAttachOptions ) (client.HijackedResponse , error ) {
182+ func (f * fakeClient ) ContainerAttach (ctx context.Context , containerID string , options client.ContainerAttachOptions ) (client.ContainerAttachResult , error ) {
196183 if f .containerAttachFunc != nil {
197184 return f .containerAttachFunc (ctx , containerID , options )
198185 }
199- return client.HijackedResponse {}, nil
186+ return client.ContainerAttachResult {}, nil
200187}
201188
202- func (f * fakeClient ) ContainerDiff (ctx context.Context , containerID string ) ([]container. FilesystemChange , error ) {
189+ func (f * fakeClient ) ContainerDiff (ctx context.Context , containerID string , _ client. ContainerDiffOptions ) (client. ContainerDiffResult , error ) {
203190 if f .containerDiffFunc != nil {
204191 return f .containerDiffFunc (ctx , containerID )
205192 }
206193
207- return []container. FilesystemChange {}, nil
194+ return client. ContainerDiffResult {}, nil
208195}
209196
210197func (f * fakeClient ) ContainerRename (ctx context.Context , oldName , newName string ) error {
@@ -215,11 +202,11 @@ func (f *fakeClient) ContainerRename(ctx context.Context, oldName, newName strin
215202 return nil
216203}
217204
218- func (f * fakeClient ) ContainerCommit (ctx context.Context , containerID string , options client.ContainerCommitOptions ) (container. CommitResponse , error ) {
205+ func (f * fakeClient ) ContainerCommit (ctx context.Context , containerID string , options client.ContainerCommitOptions ) (client. ContainerCommitResult , error ) {
219206 if f .containerCommitFunc != nil {
220207 return f .containerCommitFunc (ctx , containerID , options )
221208 }
222- return container. CommitResponse {}, nil
209+ return client. ContainerCommitResult {}, nil
223210}
224211
225212func (f * fakeClient ) ContainerPause (ctx context.Context , containerID string ) error {
0 commit comments