vendor: github.com/docker/docker 2ed904cad7055847796433cc56ef1d1de0da868c
- replace deprecated types
- also fixing some minor nits
full diff: 8941dcfcc5...2ed904cad7
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -5,48 +5,48 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
volumetypes "github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/client"
|
||||
)
|
||||
|
||||
type fakeClient struct {
|
||||
client.Client
|
||||
volumeCreateFunc func(volumetypes.VolumeCreateBody) (types.Volume, error)
|
||||
volumeInspectFunc func(volumeID string) (types.Volume, error)
|
||||
volumeListFunc func(filter filters.Args) (volumetypes.VolumeListOKBody, error)
|
||||
volumeCreateFunc func(volume.CreateOptions) (volume.Volume, error)
|
||||
volumeInspectFunc func(volumeID string) (volume.Volume, error)
|
||||
volumeListFunc func(filter filters.Args) (volume.ListResponse, error)
|
||||
volumeRemoveFunc func(volumeID string, force bool) error
|
||||
volumePruneFunc func(filter filters.Args) (types.VolumesPruneReport, error)
|
||||
}
|
||||
|
||||
func (c *fakeClient) VolumeCreate(ctx context.Context, options volumetypes.VolumeCreateBody) (types.Volume, error) {
|
||||
func (c *fakeClient) VolumeCreate(_ context.Context, options volume.CreateOptions) (volume.Volume, error) {
|
||||
if c.volumeCreateFunc != nil {
|
||||
return c.volumeCreateFunc(options)
|
||||
}
|
||||
return types.Volume{}, nil
|
||||
return volume.Volume{}, nil
|
||||
}
|
||||
|
||||
func (c *fakeClient) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) {
|
||||
func (c *fakeClient) VolumeInspect(_ context.Context, volumeID string) (volume.Volume, error) {
|
||||
if c.volumeInspectFunc != nil {
|
||||
return c.volumeInspectFunc(volumeID)
|
||||
}
|
||||
return types.Volume{}, nil
|
||||
return volume.Volume{}, nil
|
||||
}
|
||||
|
||||
func (c *fakeClient) VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumeListOKBody, error) {
|
||||
func (c *fakeClient) VolumeList(_ context.Context, filter filters.Args) (volume.ListResponse, error) {
|
||||
if c.volumeListFunc != nil {
|
||||
return c.volumeListFunc(filter)
|
||||
}
|
||||
return volumetypes.VolumeListOKBody{}, nil
|
||||
return volume.ListResponse{}, nil
|
||||
}
|
||||
|
||||
func (c *fakeClient) VolumesPrune(ctx context.Context, filter filters.Args) (types.VolumesPruneReport, error) {
|
||||
func (c *fakeClient) VolumesPrune(_ context.Context, filter filters.Args) (types.VolumesPruneReport, error) {
|
||||
if c.volumePruneFunc != nil {
|
||||
return c.volumePruneFunc(filter)
|
||||
}
|
||||
return types.VolumesPruneReport{}, nil
|
||||
}
|
||||
|
||||
func (c *fakeClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error {
|
||||
func (c *fakeClient) VolumeRemove(_ context.Context, volumeID string, force bool) error {
|
||||
if c.volumeRemoveFunc != nil {
|
||||
return c.volumeRemoveFunc(volumeID, force)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user