Replace types.volume with new volume type
This commit is contained in:
parent
0b67500cab
commit
4d2a1065d2
|
@ -3,13 +3,14 @@ package client
|
||||||
import (
|
import (
|
||||||
"context"
|
"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/api/types/filters"
|
||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetVolumes(cl *client.Client, ctx context.Context, server string, fs filters.Args) ([]*types.Volume, error) {
|
func GetVolumes(cl *client.Client, ctx context.Context, server string, fs filters.Args) ([]*volume.Volume, error) {
|
||||||
volumeListOKBody, err := cl.VolumeList(ctx, fs)
|
volumeListOptions := volume.ListOptions{fs}
|
||||||
|
volumeListOKBody, err := cl.VolumeList(ctx, volumeListOptions)
|
||||||
volumeList := volumeListOKBody.Volumes
|
volumeList := volumeListOKBody.Volumes
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return volumeList, err
|
return volumeList, err
|
||||||
|
@ -18,7 +19,7 @@ func GetVolumes(cl *client.Client, ctx context.Context, server string, fs filter
|
||||||
return volumeList, nil
|
return volumeList, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetVolumeNames(volumes []*types.Volume) []string {
|
func GetVolumeNames(volumes []*volume.Volume) []string {
|
||||||
var volumeNames []string
|
var volumeNames []string
|
||||||
|
|
||||||
for _, vol := range volumes {
|
for _, vol := range volumes {
|
||||||
|
|
Loading…
Reference in New Issue