Replace types.volume with new volume type
This commit is contained in:
parent
0b67500cab
commit
4d2a1065d2
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue