@@ -12,25 +12,26 @@ import (
1212 "github.com/docker/docker/api/types/image"
1313 networktypes "github.com/docker/docker/api/types/network"
1414 "github.com/docker/docker/api/types/registry"
15+ "github.com/docker/docker/api/types/system"
1516 specs "github.com/opencontainers/image-spec/specs-go/v1"
1617
1718 "github.com/coder/envbox/dockerutil"
1819)
1920
20- var _ dockerutil.DockerClient = MockClient {}
21+ var _ dockerutil.Client = MockClient {}
2122
2223// MockClient provides overrides for functions that are called in envbox.
2324type MockClient struct {
24- ImagePullFn func (_ context.Context , ref string , options dockertypes. ImagePullOptions ) (io.ReadCloser , error )
25+ ImagePullFn func (_ context.Context , ref string , options image. PullOptions ) (io.ReadCloser , error )
2526 ContainerCreateFn func (_ context.Context , config * containertypes.Config , hostConfig * containertypes.HostConfig , networkingConfig * networktypes.NetworkingConfig , _ * specs.Platform , containerName string ) (containertypes.CreateResponse , error )
2627 ImagePruneFn func (_ context.Context , pruneFilter filters.Args ) (dockertypes.ImagesPruneReport , error )
27- ContainerStartFn func (_ context.Context , container string , options dockertypes. ContainerStartOptions ) error
28+ ContainerStartFn func (_ context.Context , container string , options containertypes. StartOptions ) error
2829 ContainerExecAttachFn func (_ context.Context , execID string , config dockertypes.ExecStartCheck ) (dockertypes.HijackedResponse , error )
2930 ContainerExecCreateFn func (_ context.Context , container string , config dockertypes.ExecConfig ) (dockertypes.IDResponse , error )
3031 ContainerExecStartFn func (_ context.Context , execID string , config dockertypes.ExecStartCheck ) error
3132 ContainerExecInspectFn func (_ context.Context , execID string ) (dockertypes.ContainerExecInspect , error )
3233 ContainerInspectFn func (_ context.Context , container string ) (dockertypes.ContainerJSON , error )
33- ContainerRemoveFn func (_ context.Context , container string , options dockertypes. ContainerRemoveOptions ) error
34+ ContainerRemoveFn func (_ context.Context , container string , options containertypes. RemoveOptions ) error
3435 PingFn func (_ context.Context ) (dockertypes.Ping , error )
3536}
3637
@@ -46,42 +47,42 @@ func (MockClient) BuildCancel(_ context.Context, _ string) error {
4647 panic ("not implemented" )
4748}
4849
49- func (MockClient ) ImageCreate (_ context.Context , _ string , _ dockertypes. ImageCreateOptions ) (io.ReadCloser , error ) {
50+ func (MockClient ) ImageCreate (_ context.Context , _ string , _ image. CreateOptions ) (io.ReadCloser , error ) {
5051 panic ("not implemented" )
5152}
5253
5354func (MockClient ) ImageHistory (_ context.Context , _ string ) ([]image.HistoryResponseItem , error ) {
5455 panic ("not implemented" )
5556}
5657
57- func (MockClient ) ImageImport (_ context.Context , _ dockertypes. ImageImportSource , _ string , _ dockertypes. ImageImportOptions ) (io.ReadCloser , error ) {
58+ func (MockClient ) ImageImport (_ context.Context , _ image. ImportSource , _ string , _ image. ImportOptions ) (io.ReadCloser , error ) {
5859 panic ("not implemented" )
5960}
6061
6162func (MockClient ) ImageInspectWithRaw (_ context.Context , _ string ) (dockertypes.ImageInspect , []byte , error ) {
6263 panic ("not implemented" )
6364}
6465
65- func (MockClient ) ImageList (_ context.Context , _ dockertypes. ImageListOptions ) ([]dockertypes. ImageSummary , error ) {
66+ func (MockClient ) ImageList (_ context.Context , _ image. ListOptions ) ([]image. Summary , error ) {
6667 panic ("not implemented" )
6768}
6869
6970func (MockClient ) ImageLoad (_ context.Context , _ io.Reader , _ bool ) (dockertypes.ImageLoadResponse , error ) {
7071 panic ("not implemented" )
7172}
7273
73- func (m MockClient ) ImagePull (ctx context.Context , ref string , options dockertypes. ImagePullOptions ) (io.ReadCloser , error ) {
74+ func (m MockClient ) ImagePull (ctx context.Context , ref string , options image. PullOptions ) (io.ReadCloser , error ) {
7475 if m .ImagePullFn == nil {
7576 return io .NopCloser (strings .NewReader ("" )), nil
7677 }
7778 return m .ImagePullFn (ctx , ref , options )
7879}
7980
80- func (MockClient ) ImagePush (_ context.Context , _ string , _ dockertypes. ImagePushOptions ) (io.ReadCloser , error ) {
81+ func (MockClient ) ImagePush (_ context.Context , _ string , _ image. PushOptions ) (io.ReadCloser , error ) {
8182 panic ("not implemented" )
8283}
8384
84- func (MockClient ) ImageRemove (_ context.Context , _ string , _ dockertypes. ImageRemoveOptions ) ([]dockertypes. ImageDeleteResponseItem , error ) {
85+ func (MockClient ) ImageRemove (_ context.Context , _ string , _ image. RemoveOptions ) ([]image. DeleteResponse , error ) {
8586 panic ("not implemented" )
8687}
8788
@@ -108,11 +109,11 @@ func (MockClient) Events(_ context.Context, _ dockertypes.EventsOptions) (<-chan
108109 panic ("not implemented" )
109110}
110111
111- func (MockClient ) Info (_ context.Context ) (dockertypes .Info , error ) {
112+ func (MockClient ) Info (_ context.Context ) (system .Info , error ) {
112113 panic ("not implemented" )
113114}
114115
115- func (MockClient ) RegistryLogin (_ context.Context , _ dockertypes .AuthConfig ) (registry.AuthenticateOKBody , error ) {
116+ func (MockClient ) RegistryLogin (_ context.Context , _ registry .AuthConfig ) (registry.AuthenticateOKBody , error ) {
116117 panic ("not implemented" )
117118}
118119
@@ -127,11 +128,11 @@ func (m MockClient) Ping(ctx context.Context) (dockertypes.Ping, error) {
127128 return m .PingFn (ctx )
128129}
129130
130- func (MockClient ) ContainerAttach (_ context.Context , _ string , _ dockertypes. ContainerAttachOptions ) (dockertypes.HijackedResponse , error ) {
131+ func (MockClient ) ContainerAttach (_ context.Context , _ string , _ containertypes. AttachOptions ) (dockertypes.HijackedResponse , error ) {
131132 panic ("not implemented" )
132133}
133134
134- func (MockClient ) ContainerCommit (_ context.Context , _ string , _ dockertypes. ContainerCommitOptions ) (dockertypes.IDResponse , error ) {
135+ func (MockClient ) ContainerCommit (_ context.Context , _ string , _ containertypes. CommitOptions ) (dockertypes.IDResponse , error ) {
135136 panic ("not implemented" )
136137}
137138
@@ -142,7 +143,7 @@ func (m MockClient) ContainerCreate(ctx context.Context, config *containertypes.
142143 return m .ContainerCreateFn (ctx , config , hostConfig , networkingConfig , pspecs , containerName )
143144}
144145
145- func (MockClient ) ContainerDiff (_ context.Context , _ string ) ([]containertypes.ContainerChangeResponseItem , error ) {
146+ func (MockClient ) ContainerDiff (_ context.Context , _ string ) ([]containertypes.FilesystemChange , error ) {
146147 panic ("not implemented" )
147148}
148149
@@ -168,7 +169,7 @@ func (m MockClient) ContainerExecInspect(ctx context.Context, id string) (docker
168169 return m .ContainerExecInspectFn (ctx , id )
169170}
170171
171- func (MockClient ) ContainerExecResize (_ context.Context , _ string , _ dockertypes .ResizeOptions ) error {
172+ func (MockClient ) ContainerExecResize (_ context.Context , _ string , _ containertypes .ResizeOptions ) error {
172173 panic ("not implemented" )
173174}
174175
@@ -198,19 +199,19 @@ func (MockClient) ContainerKill(_ context.Context, _ string, _ string) error {
198199 panic ("not implemented" )
199200}
200201
201- func (MockClient ) ContainerList (_ context.Context , _ dockertypes. ContainerListOptions ) ([]dockertypes.Container , error ) {
202+ func (MockClient ) ContainerList (_ context.Context , _ containertypes. ListOptions ) ([]dockertypes.Container , error ) {
202203 panic ("not implemented" )
203204}
204205
205- func (MockClient ) ContainerLogs (_ context.Context , _ string , _ dockertypes. ContainerLogsOptions ) (io.ReadCloser , error ) {
206+ func (MockClient ) ContainerLogs (_ context.Context , _ string , _ containertypes. LogsOptions ) (io.ReadCloser , error ) {
206207 panic ("not implemented" )
207208}
208209
209210func (MockClient ) ContainerPause (_ context.Context , _ string ) error {
210211 panic ("not implemented" )
211212}
212213
213- func (m MockClient ) ContainerRemove (ctx context.Context , name string , options dockertypes. ContainerRemoveOptions ) error {
214+ func (m MockClient ) ContainerRemove (ctx context.Context , name string , options containertypes. RemoveOptions ) error {
214215 if m .ContainerRemoveFn == nil {
215216 return nil
216217 }
@@ -221,7 +222,7 @@ func (MockClient) ContainerRename(_ context.Context, _ string, _ string) error {
221222 panic ("not implemented" )
222223}
223224
224- func (MockClient ) ContainerResize (_ context.Context , _ string , _ dockertypes .ResizeOptions ) error {
225+ func (MockClient ) ContainerResize (_ context.Context , _ string , _ containertypes .ResizeOptions ) error {
225226 panic ("not implemented" )
226227}
227228
@@ -237,7 +238,7 @@ func (MockClient) ContainerStats(_ context.Context, _ string, _ bool) (dockertyp
237238 panic ("not implemented" )
238239}
239240
240- func (m MockClient ) ContainerStart (ctx context.Context , name string , options dockertypes. ContainerStartOptions ) error {
241+ func (m MockClient ) ContainerStart (ctx context.Context , name string , options containertypes. StartOptions ) error {
241242 if m .ContainerStartFn == nil {
242243 return nil
243244 }
0 commit comments