From 4d2a1065d2c260211630eeb8754cf2ad6b7cb7da Mon Sep 17 00:00:00 2001 From: Richard M Date: Fri, 14 Jul 2023 20:44:25 +0100 Subject: [PATCH] Replace types.volume with new volume type --- pkg/client/volumes.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/client/volumes.go b/pkg/client/volumes.go index f0802b05..90bbd493 100644 --- a/pkg/client/volumes.go +++ b/pkg/client/volumes.go @@ -3,13 +3,14 @@ package client import ( "context" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/volume" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" ) -func GetVolumes(cl *client.Client, ctx context.Context, server string, fs filters.Args) ([]*types.Volume, error) { - volumeListOKBody, err := cl.VolumeList(ctx, fs) +func GetVolumes(cl *client.Client, ctx context.Context, server string, fs filters.Args) ([]*volume.Volume, error) { + volumeListOptions := volume.ListOptions{fs} + volumeListOKBody, err := cl.VolumeList(ctx, volumeListOptions) volumeList := volumeListOKBody.Volumes if err != nil { return volumeList, err @@ -18,7 +19,7 @@ func GetVolumes(cl *client.Client, ctx context.Context, server string, fs filter return volumeList, nil } -func GetVolumeNames(volumes []*types.Volume) []string { +func GetVolumeNames(volumes []*volume.Volume) []string { var volumeNames []string for _, vol := range volumes {