Skip to content

Commit f261059

Browse files
committed
fix: keep up with Docker's API type refactoring shuffle
Signed-off-by: thediveo <thediveo@gmx.eu>
1 parent 3aac307 commit f261059

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
![build and test](https://github.com/thediveo/morbyd/actions/workflows/buildandtest.yaml/badge.svg?branch=master)
88
![goroutines](https://img.shields.io/badge/go%20routines-not%20leaking-success)
99
[![Go Report Card](https://goreportcard.com/badge/github.com/thediveo/morbyd)](https://goreportcard.com/report/github.com/thediveo/morbyd)
10-
![Coverage](https://img.shields.io/badge/Coverage-100.0%25-brightgreen)
10+
![Coverage](https://img.shields.io/badge/Coverage-98.6%25-brightgreen)
1111

1212
`morbyd` is a thin layer on top of the standard Docker Go client to easily build
1313
and run throw-away test Docker images and containers. And to easily run commands

client_mock_test.go

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,25 @@ func newWrappedClient(ctrl *mock.Controller, wrapped moby.Client, withouts []str
131131

132132
if !slices.Contains(withouts, "ContainerExecCreate") {
133133
rec.ContainerExecCreate(Any, Any, Any).AnyTimes().
134-
DoAndReturn(func(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) {
134+
DoAndReturn(func(ctx context.Context, container string, config container.ExecOptions) (container.ExecCreateResponse, error) {
135135
return wrapped.ContainerExecCreate(ctx, container, config)
136136
})
137137
}
138138
if !slices.Contains(withouts, "ContainerExecStart") {
139139
rec.ContainerExecStart(Any, Any, Any).AnyTimes().
140-
DoAndReturn(func(ctx context.Context, execID string, config types.ExecStartCheck) error {
140+
DoAndReturn(func(ctx context.Context, execID string, config container.ExecStartOptions) error {
141141
return wrapped.ContainerExecStart(ctx, execID, config)
142142
})
143143
}
144144
if !slices.Contains(withouts, "ContainerExecAttach") {
145145
rec.ContainerExecAttach(Any, Any, Any).AnyTimes().
146-
DoAndReturn(func(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) {
146+
DoAndReturn(func(ctx context.Context, execID string, config container.ExecAttachOptions) (types.HijackedResponse, error) {
147147
return wrapped.ContainerExecAttach(ctx, execID, config)
148148
})
149149
}
150150
if !slices.Contains(withouts, "ContainerExecInspect") {
151151
rec.ContainerExecInspect(Any, Any).AnyTimes().
152-
DoAndReturn(func(ctx context.Context, execID string) (types.ContainerExecInspect, error) {
152+
DoAndReturn(func(ctx context.Context, execID string) (container.ExecInspect, error) {
153153
return wrapped.ContainerExecInspect(ctx, execID)
154154
})
155155
}
@@ -193,19 +193,19 @@ func newWrappedClient(ctrl *mock.Controller, wrapped moby.Client, withouts []str
193193

194194
if !slices.Contains(withouts, "NetworkCreate") {
195195
rec.NetworkCreate(Any, Any, Any).AnyTimes().
196-
DoAndReturn(func(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
196+
DoAndReturn(func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) {
197197
return wrapped.NetworkCreate(ctx, name, options)
198198
})
199199
}
200200
if !slices.Contains(withouts, "NetworkInspect") {
201201
rec.NetworkInspect(Any, Any, Any).AnyTimes().
202-
DoAndReturn(func(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, error) {
202+
DoAndReturn(func(ctx context.Context, networkID string, options network.InspectOptions) (network.Summary, error) {
203203
return wrapped.NetworkInspect(ctx, networkID, options)
204204
})
205205
}
206206
if !slices.Contains(withouts, "NetworkList") {
207207
rec.NetworkList(Any, Any).AnyTimes().
208-
DoAndReturn(func(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
208+
DoAndReturn(func(ctx context.Context, options network.ListOptions) ([]network.Summary, error) {
209209
return wrapped.NetworkList(ctx, options)
210210
})
211211
}

moby/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Client interface {
5050
ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
5151

5252
ContainerExecAttach(ctx context.Context, execID string, config container.ExecAttachOptions) (types.HijackedResponse, error)
53-
ContainerExecCreate(ctx context.Context, container string, config container.ExecOptions) (types.IDResponse, error)
53+
ContainerExecCreate(ctx context.Context, container string, config container.ExecOptions) (container.ExecCreateResponse, error)
5454
ContainerExecStart(ctx context.Context, execID string, config container.ExecStartOptions) error
5555
ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error)
5656

0 commit comments

Comments
 (0)