From fe8516cf4b119da4bfd3d8697d7d81f96f36a364 Mon Sep 17 00:00:00 2001 From: Austin Vazquez Date: Thu, 21 Aug 2025 20:45:23 -0500 Subject: [PATCH] client: refactor `InspectOptions` to `NetworkInspectOptions` Signed-off-by: Austin Vazquez --- client/client_interfaces.go | 4 +-- client/network_inspect.go | 4 +-- client/network_inspect_opts.go | 4 +-- client/network_inspect_test.go | 14 ++++----- integration-cli/docker_api_swarm_test.go | 4 +-- integration/container/daemon_linux_test.go | 2 +- integration/daemon/daemon_linux_test.go | 2 +- integration/internal/network/states.go | 2 +- .../network/bridge/bridge_linux_test.go | 6 ++-- integration/network/inspect_test.go | 10 +++---- integration/network/network_linux_test.go | 2 +- integration/network/service_test.go | 30 +++++++++---------- integration/networking/bridge_linux_test.go | 4 +-- integration/service/update_test.go | 4 +-- .../moby/moby/client/client_interfaces.go | 4 +-- .../moby/moby/client/network_inspect.go | 4 +-- .../moby/moby/client/network_inspect_opts.go | 4 +-- 17 files changed, 52 insertions(+), 52 deletions(-) diff --git a/client/client_interfaces.go b/client/client_interfaces.go index 0b9229bfba..f24da421d7 100644 --- a/client/client_interfaces.go +++ b/client/client_interfaces.go @@ -131,8 +131,8 @@ type NetworkAPIClient interface { NetworkConnect(ctx context.Context, network, container string, config *network.EndpointSettings) error NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) NetworkDisconnect(ctx context.Context, network, container string, force bool) error - NetworkInspect(ctx context.Context, network string, options InspectOptions) (network.Inspect, error) - NetworkInspectWithRaw(ctx context.Context, network string, options InspectOptions) (network.Inspect, []byte, error) + NetworkInspect(ctx context.Context, network string, options NetworkInspectOptions) (network.Inspect, error) + NetworkInspectWithRaw(ctx context.Context, network string, options NetworkInspectOptions) (network.Inspect, []byte, error) NetworkList(ctx context.Context, options NetworkListOptions) ([]network.Summary, error) NetworkRemove(ctx context.Context, network string) error NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error) diff --git a/client/network_inspect.go b/client/network_inspect.go index 245fab65a4..83e8cd1cb3 100644 --- a/client/network_inspect.go +++ b/client/network_inspect.go @@ -11,13 +11,13 @@ import ( ) // NetworkInspect returns the information for a specific network configured in the docker host. -func (cli *Client) NetworkInspect(ctx context.Context, networkID string, options InspectOptions) (network.Inspect, error) { +func (cli *Client) NetworkInspect(ctx context.Context, networkID string, options NetworkInspectOptions) (network.Inspect, error) { networkResource, _, err := cli.NetworkInspectWithRaw(ctx, networkID, options) return networkResource, err } // NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation. -func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string, options InspectOptions) (network.Inspect, []byte, error) { +func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string, options NetworkInspectOptions) (network.Inspect, []byte, error) { networkID, err := trimID("network", networkID) if err != nil { return network.Inspect{}, nil, err diff --git a/client/network_inspect_opts.go b/client/network_inspect_opts.go index 55b6d18fdc..d83f113e17 100644 --- a/client/network_inspect_opts.go +++ b/client/network_inspect_opts.go @@ -1,7 +1,7 @@ package client -// InspectOptions holds parameters to inspect network. -type InspectOptions struct { +// NetworkInspectOptions holds parameters to inspect network. +type NetworkInspectOptions struct { Scope string Verbose bool } diff --git a/client/network_inspect_test.go b/client/network_inspect_test.go index fd5d1c5320..ed7e78669a 100644 --- a/client/network_inspect_test.go +++ b/client/network_inspect_test.go @@ -68,39 +68,39 @@ func TestNetworkInspect(t *testing.T) { t.Run("empty ID", func(t *testing.T) { // verify that the client does not create a request if the network-ID/name is empty. - _, err := client.NetworkInspect(context.Background(), "", InspectOptions{}) + _, err := client.NetworkInspect(context.Background(), "", NetworkInspectOptions{}) assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) - _, err = client.NetworkInspect(context.Background(), " ", InspectOptions{}) + _, err = client.NetworkInspect(context.Background(), " ", NetworkInspectOptions{}) assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) }) t.Run("no options", func(t *testing.T) { - r, err := client.NetworkInspect(context.Background(), "network_id", InspectOptions{}) + r, err := client.NetworkInspect(context.Background(), "network_id", NetworkInspectOptions{}) assert.NilError(t, err) assert.Check(t, is.Equal(r.Name, "mynetwork")) }) t.Run("verbose", func(t *testing.T) { - r, err := client.NetworkInspect(context.Background(), "network_id", InspectOptions{Verbose: true}) + r, err := client.NetworkInspect(context.Background(), "network_id", NetworkInspectOptions{Verbose: true}) assert.NilError(t, err) assert.Check(t, is.Equal(r.Name, "mynetwork")) _, ok := r.Services["web"] assert.Check(t, ok, "expected service `web` missing in the verbose output") }) t.Run("global scope", func(t *testing.T) { - _, err := client.NetworkInspect(context.Background(), "network_id", InspectOptions{Scope: "global"}) + _, err := client.NetworkInspect(context.Background(), "network_id", NetworkInspectOptions{Scope: "global"}) assert.Check(t, is.ErrorContains(err, "Error: No such network: network_id")) assert.Check(t, is.ErrorType(err, cerrdefs.IsNotFound)) }) t.Run("unknown network", func(t *testing.T) { - _, err := client.NetworkInspect(context.Background(), "unknown", InspectOptions{}) + _, err := client.NetworkInspect(context.Background(), "unknown", NetworkInspectOptions{}) assert.Check(t, is.ErrorContains(err, "Error: No such network: unknown")) assert.Check(t, is.ErrorType(err, cerrdefs.IsNotFound)) }) t.Run("server error", func(t *testing.T) { // Just testing that an internal server error is converted correctly by the client - _, err := client.NetworkInspect(context.Background(), "test-500-response", InspectOptions{}) + _, err := client.NetworkInspect(context.Background(), "test-500-response", NetworkInspectOptions{}) assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) }) } diff --git a/integration-cli/docker_api_swarm_test.go b/integration-cli/docker_api_swarm_test.go index e8874c5177..3cd9396d65 100644 --- a/integration-cli/docker_api_swarm_test.go +++ b/integration-cli/docker_api_swarm_test.go @@ -1026,11 +1026,11 @@ func (s *DockerSwarmSuite) TestAPINetworkInspectWithScope(c *testing.T) { resp, err := apiclient.NetworkCreate(ctx, name, network.CreateOptions{Driver: "overlay"}) assert.NilError(c, err) - nw, err := apiclient.NetworkInspect(ctx, name, client.InspectOptions{}) + nw, err := apiclient.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(c, err) assert.Check(c, is.Equal("swarm", nw.Scope)) assert.Check(c, is.Equal(resp.ID, nw.ID)) - _, err = apiclient.NetworkInspect(ctx, name, client.InspectOptions{Scope: "local"}) + _, err = apiclient.NetworkInspect(ctx, name, client.NetworkInspectOptions{Scope: "local"}) assert.Check(c, is.ErrorType(err, cerrdefs.IsNotFound)) } diff --git a/integration/container/daemon_linux_test.go b/integration/container/daemon_linux_test.go index d2dac015a5..2e67c22bc3 100644 --- a/integration/container/daemon_linux_test.go +++ b/integration/container/daemon_linux_test.go @@ -153,7 +153,7 @@ func TestDaemonHostGatewayIP(t *testing.T) { assert.NilError(t, err) assert.Assert(t, is.Len(res.Stderr(), 0)) assert.Equal(t, 0, res.ExitCode) - inspect, err := c.NetworkInspect(ctx, "bridge", client.InspectOptions{}) + inspect, err := c.NetworkInspect(ctx, "bridge", client.NetworkInspectOptions{}) assert.NilError(t, err) assert.Check(t, is.Contains(res.Stdout(), inspect.IPAM.Config[0].Gateway)) c.ContainerRemove(ctx, cID, containertypes.RemoveOptions{Force: true}) diff --git a/integration/daemon/daemon_linux_test.go b/integration/daemon/daemon_linux_test.go index 828f73c4df..986b7308d9 100644 --- a/integration/daemon/daemon_linux_test.go +++ b/integration/daemon/daemon_linux_test.go @@ -419,7 +419,7 @@ func testDefaultBridgeIPAM(ctx context.Context, t *testing.T, tc defaultBridgeIP c := d.NewClientT(t) defer c.Close() - insp, err := c.NetworkInspect(ctx, network.NetworkBridge, client.InspectOptions{}) + insp, err := c.NetworkInspect(ctx, network.NetworkBridge, client.NetworkInspectOptions{}) assert.NilError(t, err) expIPAMConfig := slices.Clone(tc.expIPAMConfig) for i := range expIPAMConfig { diff --git a/integration/internal/network/states.go b/integration/internal/network/states.go index b217b5b612..f15f0be2fc 100644 --- a/integration/internal/network/states.go +++ b/integration/internal/network/states.go @@ -10,7 +10,7 @@ import ( // IsRemoved verifies the network is removed. func IsRemoved(ctx context.Context, apiClient client.NetworkAPIClient, networkID string) func(log poll.LogT) poll.Result { return func(log poll.LogT) poll.Result { - _, err := apiClient.NetworkInspect(ctx, networkID, client.InspectOptions{}) + _, err := apiClient.NetworkInspect(ctx, networkID, client.NetworkInspectOptions{}) if err == nil { return poll.Continue("waiting for network %s to be removed", networkID) } diff --git a/integration/network/bridge/bridge_linux_test.go b/integration/network/bridge/bridge_linux_test.go index 56ae210848..2d2a6559f8 100644 --- a/integration/network/bridge/bridge_linux_test.go +++ b/integration/network/bridge/bridge_linux_test.go @@ -65,7 +65,7 @@ func TestCreateWithIPv6DefaultsToULAPrefix(t *testing.T) { network.CreateNoError(ctx, t, apiClient, nwName, network.WithIPv6()) defer network.RemoveNoError(ctx, t, apiClient, nwName) - nw, err := apiClient.NetworkInspect(ctx, "testnetula", client.InspectOptions{}) + nw, err := apiClient.NetworkInspect(ctx, "testnetula", client.NetworkInspectOptions{}) assert.NilError(t, err) for _, ipam := range nw.IPAM.Config { @@ -92,7 +92,7 @@ func TestCreateWithIPv6WithoutEnableIPv6Flag(t *testing.T) { network.CreateNoError(ctx, t, apiClient, nwName) defer network.RemoveNoError(ctx, t, apiClient, nwName) - nw, err := apiClient.NetworkInspect(ctx, "testnetula", client.InspectOptions{}) + nw, err := apiClient.NetworkInspect(ctx, "testnetula", client.NetworkInspectOptions{}) assert.NilError(t, err) for _, ipam := range nw.IPAM.Config { @@ -137,7 +137,7 @@ func TestDefaultIPvOptOverride(t *testing.T) { network.CreateNoError(ctx, t, c, netName, nopts...) defer network.RemoveNoError(ctx, t, c, netName) - insp, err := c.NetworkInspect(ctx, netName, client.InspectOptions{}) + insp, err := c.NetworkInspect(ctx, netName, client.NetworkInspectOptions{}) assert.NilError(t, err) t.Log("override4", override4, "override6", override6, "->", insp.Options) diff --git a/integration/network/inspect_test.go b/integration/network/inspect_test.go index 2384659862..b9c084b080 100644 --- a/integration/network/inspect_test.go +++ b/integration/network/inspect_test.go @@ -41,33 +41,33 @@ func TestInspectNetwork(t *testing.T) { tests := []struct { name string network string - opts client.InspectOptions + opts client.NetworkInspectOptions }{ { name: "full network id", network: overlayID, - opts: client.InspectOptions{ + opts: client.NetworkInspectOptions{ Verbose: true, }, }, { name: "partial network id", network: overlayID[0:11], - opts: client.InspectOptions{ + opts: client.NetworkInspectOptions{ Verbose: true, }, }, { name: "network name", network: networkName, - opts: client.InspectOptions{ + opts: client.NetworkInspectOptions{ Verbose: true, }, }, { name: "network name and swarm scope", network: networkName, - opts: client.InspectOptions{ + opts: client.NetworkInspectOptions{ Verbose: true, Scope: "swarm", }, diff --git a/integration/network/network_linux_test.go b/integration/network/network_linux_test.go index f8f72d0467..055696c60b 100644 --- a/integration/network/network_linux_test.go +++ b/integration/network/network_linux_test.go @@ -89,7 +89,7 @@ func TestHostIPv4BridgeLabel(t *testing.T) { network.WithOption("com.docker.network.bridge.name", bridgeName), ) defer network.RemoveNoError(ctx, t, c, bridgeName) - out, err := c.NetworkInspect(ctx, bridgeName, client.InspectOptions{Verbose: true}) + out, err := c.NetworkInspect(ctx, bridgeName, client.NetworkInspectOptions{Verbose: true}) assert.NilError(t, err) assert.Assert(t, len(out.IPAM.Config) > 0) // Make sure the SNAT rule exists diff --git a/integration/network/service_test.go b/integration/network/service_test.go index f4c8c28d97..c117cf8f9c 100644 --- a/integration/network/service_test.go +++ b/integration/network/service_test.go @@ -45,7 +45,7 @@ func TestDaemonRestartWithLiveRestore(t *testing.T) { defer c.Close() // Verify bridge network's subnet - out, err := c.NetworkInspect(ctx, "bridge", client.InspectOptions{}) + out, err := c.NetworkInspect(ctx, "bridge", client.NetworkInspectOptions{}) assert.NilError(t, err) subnet := out.IPAM.Config[0].Subnet @@ -55,7 +55,7 @@ func TestDaemonRestartWithLiveRestore(t *testing.T) { "--default-address-pool", "base=175.33.0.0/16,size=24", ) - out1, err := c.NetworkInspect(ctx, "bridge", client.InspectOptions{}) + out1, err := c.NetworkInspect(ctx, "bridge", client.NetworkInspectOptions{}) assert.NilError(t, err) // Make sure docker0 doesn't get override with new IP in live restore case assert.Equal(t, out1.IPAM.Config[0].Subnet, subnet) @@ -82,7 +82,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) { defer c.Close() // Verify bridge network's subnet - out, err := c.NetworkInspect(ctx, "bridge", client.InspectOptions{}) + out, err := c.NetworkInspect(ctx, "bridge", client.NetworkInspectOptions{}) assert.NilError(t, err) assert.Equal(t, out.IPAM.Config[0].Subnet, "175.30.0.0/16") @@ -92,7 +92,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) { network.WithDriver("bridge"), ) defer network.RemoveNoError(ctx, t, c, name) - out, err = c.NetworkInspect(ctx, name, client.InspectOptions{}) + out, err = c.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(t, err) assert.Check(t, is.Equal(out.IPAM.Config[0].Subnet, "175.33.0.0/24")) @@ -102,7 +102,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) { network.WithDriver("bridge"), ) defer network.RemoveNoError(ctx, t, c, name) - out, err = c.NetworkInspect(ctx, name, client.InspectOptions{}) + out, err = c.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(t, err) assert.Check(t, is.Equal(out.IPAM.Config[0].Subnet, "175.33.1.0/24")) } @@ -127,7 +127,7 @@ func TestDaemonRestartWithExistingNetwork(t *testing.T) { defer network.RemoveNoError(ctx, t, c, name) // Verify bridge network's subnet - out, err := c.NetworkInspect(ctx, name, client.InspectOptions{}) + out, err := c.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(t, err) networkip := out.IPAM.Config[0].Subnet @@ -137,7 +137,7 @@ func TestDaemonRestartWithExistingNetwork(t *testing.T) { "--default-address-pool", "base=175.33.0.0/16,size=24") defer delInterface(ctx, t, "docker0") - out1, err := c.NetworkInspect(ctx, name, client.InspectOptions{}) + out1, err := c.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(t, err) assert.Equal(t, out1.IPAM.Config[0].Subnet, networkip) } @@ -163,7 +163,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) { defer network.RemoveNoError(ctx, t, c, name) // Verify bridge network's subnet - out, err := c.NetworkInspect(ctx, name, client.InspectOptions{}) + out, err := c.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(t, err) networkip := out.IPAM.Config[0].Subnet @@ -173,7 +173,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) { network.WithDriver("bridge"), ) defer network.RemoveNoError(ctx, t, c, name) - out, err = c.NetworkInspect(ctx, name, client.InspectOptions{}) + out, err = c.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(t, err) networkip2 := out.IPAM.Config[0].Subnet @@ -190,7 +190,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) { network.WithDriver("bridge"), ) defer network.RemoveNoError(ctx, t, c, name) - out1, err := c.NetworkInspect(ctx, name, client.InspectOptions{}) + out1, err := c.NetworkInspect(ctx, name, client.NetworkInspectOptions{}) assert.NilError(t, err) assert.Check(t, out1.IPAM.Config[0].Subnet != networkip) @@ -217,7 +217,7 @@ func TestDaemonWithBipAndDefaultNetworkPool(t *testing.T) { defer c.Close() // Verify bridge network's subnet - out, err := c.NetworkInspect(ctx, "bridge", client.InspectOptions{}) + out, err := c.NetworkInspect(ctx, "bridge", client.NetworkInspectOptions{}) assert.NilError(t, err) // Make sure BIP IP doesn't get override with new default address pool . assert.Equal(t, out.IPAM.Config[0].Subnet, "172.60.0.0/16") @@ -297,7 +297,7 @@ func TestServiceRemoveKeepsIngressNetwork(t *testing.T) { // Ensure that "ingress" is not removed or corrupted time.Sleep(10 * time.Second) - netInfo, err := c.NetworkInspect(ctx, ingressNet, client.InspectOptions{ + netInfo, err := c.NetworkInspect(ctx, ingressNet, client.NetworkInspectOptions{ Verbose: true, Scope: "swarm", }) @@ -311,7 +311,7 @@ func TestServiceRemoveKeepsIngressNetwork(t *testing.T) { //nolint:unused // for some reason, the "unused" linter marks this function as "unused" func swarmIngressReady(ctx context.Context, apiClient client.NetworkAPIClient) func(log poll.LogT) poll.Result { return func(log poll.LogT) poll.Result { - netInfo, err := apiClient.NetworkInspect(ctx, ingressNet, client.InspectOptions{ + netInfo, err := apiClient.NetworkInspect(ctx, ingressNet, client.NetworkInspectOptions{ Verbose: true, Scope: "swarm", }) @@ -443,7 +443,7 @@ func TestServiceWithDefaultAddressPoolInit(t *testing.T) { _, _, err := cli.ServiceInspectWithRaw(ctx, serviceID, swarmtypes.ServiceInspectOptions{}) assert.NilError(t, err) - out, err := cli.NetworkInspect(ctx, overlayID, client.InspectOptions{Verbose: true}) + out, err := cli.NetworkInspect(ctx, overlayID, client.NetworkInspectOptions{Verbose: true}) assert.NilError(t, err) t.Logf("%s: NetworkInspect: %+v", t.Name(), out) assert.Assert(t, len(out.IPAM.Config) > 0) @@ -454,7 +454,7 @@ func TestServiceWithDefaultAddressPoolInit(t *testing.T) { assert.Equal(t, out.IPAM.Config[0].Subnet, "20.20.1.0/24") // Also inspect ingress network and make sure its in the same subnet - out, err = cli.NetworkInspect(ctx, "ingress", client.InspectOptions{Verbose: true}) + out, err = cli.NetworkInspect(ctx, "ingress", client.NetworkInspectOptions{Verbose: true}) assert.NilError(t, err) assert.Assert(t, len(out.IPAM.Config) > 0) assert.Equal(t, out.IPAM.Config[0].Subnet, "20.20.0.0/24") diff --git a/integration/networking/bridge_linux_test.go b/integration/networking/bridge_linux_test.go index bf2772780e..93682490cf 100644 --- a/integration/networking/bridge_linux_test.go +++ b/integration/networking/bridge_linux_test.go @@ -584,7 +584,7 @@ func TestAccessToPublishedPort(t *testing.T) { // Use the default bridge addresses as host addresses (like "host-gateway", but // there's no way to tell wget to prefer ipv4/ipv6 transport, so just use the // addresses directly). - insp, err := c.NetworkInspect(ctx, "bridge", client.InspectOptions{}) + insp, err := c.NetworkInspect(ctx, "bridge", client.NetworkInspectOptions{}) assert.NilError(t, err) for _, ipamCfg := range insp.IPAM.Config { ipv := "ipv4" @@ -1821,7 +1821,7 @@ func TestNetworkInspectGateway(t *testing.T) { assert.NilError(t, err) defer network.RemoveNoError(ctx, t, c, netName) - insp, err := c.NetworkInspect(ctx, nid, client.InspectOptions{}) + insp, err := c.NetworkInspect(ctx, nid, client.NetworkInspectOptions{}) assert.NilError(t, err) for _, ipamCfg := range insp.IPAM.Config { _, err := netip.ParseAddr(ipamCfg.Gateway) diff --git a/integration/service/update_test.go b/integration/service/update_test.go index 79264dbfd2..e8659c570a 100644 --- a/integration/service/update_test.go +++ b/integration/service/update_test.go @@ -221,7 +221,7 @@ func TestServiceUpdateNetwork(t *testing.T) { poll.WaitOn(t, swarm.RunningTasksCount(ctx, cli, serviceID, instances), swarm.ServicePoll) service := getService(ctx, t, cli, serviceID) - netInfo, err := cli.NetworkInspect(ctx, testNet, client.InspectOptions{ + netInfo, err := cli.NetworkInspect(ctx, testNet, client.NetworkInspectOptions{ Verbose: true, Scope: "swarm", }) @@ -234,7 +234,7 @@ func TestServiceUpdateNetwork(t *testing.T) { assert.NilError(t, err) poll.WaitOn(t, serviceIsUpdated(ctx, cli, serviceID), swarm.ServicePoll) - netInfo, err = cli.NetworkInspect(ctx, testNet, client.InspectOptions{ + netInfo, err = cli.NetworkInspect(ctx, testNet, client.NetworkInspectOptions{ Verbose: true, Scope: "swarm", }) diff --git a/vendor/github.com/moby/moby/client/client_interfaces.go b/vendor/github.com/moby/moby/client/client_interfaces.go index 0b9229bfba..f24da421d7 100644 --- a/vendor/github.com/moby/moby/client/client_interfaces.go +++ b/vendor/github.com/moby/moby/client/client_interfaces.go @@ -131,8 +131,8 @@ type NetworkAPIClient interface { NetworkConnect(ctx context.Context, network, container string, config *network.EndpointSettings) error NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) NetworkDisconnect(ctx context.Context, network, container string, force bool) error - NetworkInspect(ctx context.Context, network string, options InspectOptions) (network.Inspect, error) - NetworkInspectWithRaw(ctx context.Context, network string, options InspectOptions) (network.Inspect, []byte, error) + NetworkInspect(ctx context.Context, network string, options NetworkInspectOptions) (network.Inspect, error) + NetworkInspectWithRaw(ctx context.Context, network string, options NetworkInspectOptions) (network.Inspect, []byte, error) NetworkList(ctx context.Context, options NetworkListOptions) ([]network.Summary, error) NetworkRemove(ctx context.Context, network string) error NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error) diff --git a/vendor/github.com/moby/moby/client/network_inspect.go b/vendor/github.com/moby/moby/client/network_inspect.go index 245fab65a4..83e8cd1cb3 100644 --- a/vendor/github.com/moby/moby/client/network_inspect.go +++ b/vendor/github.com/moby/moby/client/network_inspect.go @@ -11,13 +11,13 @@ import ( ) // NetworkInspect returns the information for a specific network configured in the docker host. -func (cli *Client) NetworkInspect(ctx context.Context, networkID string, options InspectOptions) (network.Inspect, error) { +func (cli *Client) NetworkInspect(ctx context.Context, networkID string, options NetworkInspectOptions) (network.Inspect, error) { networkResource, _, err := cli.NetworkInspectWithRaw(ctx, networkID, options) return networkResource, err } // NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation. -func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string, options InspectOptions) (network.Inspect, []byte, error) { +func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string, options NetworkInspectOptions) (network.Inspect, []byte, error) { networkID, err := trimID("network", networkID) if err != nil { return network.Inspect{}, nil, err diff --git a/vendor/github.com/moby/moby/client/network_inspect_opts.go b/vendor/github.com/moby/moby/client/network_inspect_opts.go index 55b6d18fdc..d83f113e17 100644 --- a/vendor/github.com/moby/moby/client/network_inspect_opts.go +++ b/vendor/github.com/moby/moby/client/network_inspect_opts.go @@ -1,7 +1,7 @@ package client -// InspectOptions holds parameters to inspect network. -type InspectOptions struct { +// NetworkInspectOptions holds parameters to inspect network. +type NetworkInspectOptions struct { Scope string Verbose bool }