vendor: github.com/docker/docker cd3804655a25 (master / v27.0.0-dev)

full diff: e622cea556...cd3804655a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-06-04 09:17:20 +02:00
parent 05c7d4b319
commit b6a3ce4167
17 changed files with 60 additions and 53 deletions

View File

@ -9,6 +9,7 @@ import (
"github.com/docker/cli/internal/test/builders"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/network"
"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
"gotest.tools/v3/assert"
@ -18,11 +19,11 @@ import (
func TestNetworkListErrors(t *testing.T) {
testCases := []struct {
networkListFunc func(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error)
networkListFunc func(ctx context.Context, options network.ListOptions) ([]types.NetworkResource, error)
expectedError string
}{
{
networkListFunc: func(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
networkListFunc: func(ctx context.Context, options network.ListOptions) ([]types.NetworkResource, error) {
return []types.NetworkResource{}, errors.Errorf("error creating network")
},
expectedError: "error creating network",
@ -43,7 +44,7 @@ func TestNetworkListErrors(t *testing.T) {
func TestNetworkList(t *testing.T) {
testCases := []struct {
doc string
networkListFunc func(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error)
networkListFunc func(ctx context.Context, options network.ListOptions) ([]types.NetworkResource, error)
flags map[string]string
golden string
}{
@ -53,8 +54,8 @@ func TestNetworkList(t *testing.T) {
"filter": "image.name=ubuntu",
},
golden: "network-list.golden",
networkListFunc: func(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
expectedOpts := types.NetworkListOptions{
networkListFunc: func(ctx context.Context, options network.ListOptions) ([]types.NetworkResource, error) {
expectedOpts := network.ListOptions{
Filters: filters.NewArgs(filters.Arg("image.name", "ubuntu")),
}
assert.Check(t, is.DeepEqual(expectedOpts, options, cmp.AllowUnexported(filters.Args{})))
@ -71,7 +72,7 @@ func TestNetworkList(t *testing.T) {
"format": "{{ .Name }}",
},
golden: "network-list-sort.golden",
networkListFunc: func(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
networkListFunc: func(ctx context.Context, options network.ListOptions) ([]types.NetworkResource, error) {
return []types.NetworkResource{
*builders.NetworkResource(builders.NetworkResourceName("network-2-foo")),
*builders.NetworkResource(builders.NetworkResourceName("network-1-foo")),