@@ -16,8 +16,8 @@ import (
1616 "github.com/docker/cli/internal/lazyregexp"
1717 "github.com/docker/cli/opts"
1818 "github.com/docker/docker/api/types/container"
19- mounttypes "github.com/docker/docker/api/types/mount"
20- networktypes "github.com/docker/docker/api/types/network"
19+ "github.com/docker/docker/api/types/mount"
20+ "github.com/docker/docker/api/types/network"
2121 "github.com/docker/go-connections/nat"
2222 "github.com/pkg/errors"
2323 "github.com/spf13/pflag"
@@ -323,7 +323,7 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
323323type containerConfig struct {
324324 Config * container.Config
325325 HostConfig * container.HostConfig
326- NetworkingConfig * networktypes .NetworkingConfig
326+ NetworkingConfig * network .NetworkingConfig
327327}
328328
329329// parse parses the args for the specified command and generates a Config,
@@ -372,7 +372,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
372372 if parsed .Source != "" {
373373 toBind := bind
374374
375- if parsed .Type == string (mounttypes .TypeBind ) {
375+ if parsed .Type == string (mount .TypeBind ) {
376376 if hostPart , targetPath , ok := strings .Cut (bind , ":" ); ok {
377377 if ! filepath .IsAbs (hostPart ) && strings .HasPrefix (hostPart , "." ) {
378378 if absHostPart , err := filepath .Abs (hostPart ); err == nil {
@@ -706,8 +706,8 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
706706 config .StdinOnce = true
707707 }
708708
709- networkingConfig := & networktypes .NetworkingConfig {
710- EndpointsConfig : make (map [string ]* networktypes .EndpointSettings ),
709+ networkingConfig := & network .NetworkingConfig {
710+ EndpointsConfig : make (map [string ]* network .EndpointSettings ),
711711 }
712712
713713 networkingConfig .EndpointsConfig , err = parseNetworkOpts (copts )
@@ -735,9 +735,9 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
735735// this function may return _multiple_ endpoints, which is not currently supported
736736// by the daemon, but may be in future; it's up to the daemon to produce an error
737737// in case that is not supported.
738- func parseNetworkOpts (copts * containerOptions ) (map [string ]* networktypes .EndpointSettings , error ) {
738+ func parseNetworkOpts (copts * containerOptions ) (map [string ]* network .EndpointSettings , error ) {
739739 var (
740- endpoints = make (map [string ]* networktypes .EndpointSettings , len (copts .netMode .Value ()))
740+ endpoints = make (map [string ]* network .EndpointSettings , len (copts .netMode .Value ()))
741741 hasUserDefined , hasNonUserDefined bool
742742 )
743743
@@ -783,7 +783,7 @@ func parseNetworkOpts(copts *containerOptions) (map[string]*networktypes.Endpoin
783783 // and only a single network is specified, omit the endpoint-configuration
784784 // on the client (the daemon will still create it when creating the container)
785785 if i == 0 && len (copts .netMode .Value ()) == 1 {
786- if ep == nil || reflect .DeepEqual (* ep , networktypes .EndpointSettings {}) {
786+ if ep == nil || reflect .DeepEqual (* ep , network .EndpointSettings {}) {
787787 continue
788788 }
789789 }
@@ -841,7 +841,7 @@ func applyContainerOptions(n *opts.NetworkAttachmentOpts, copts *containerOption
841841 return nil
842842}
843843
844- func parseNetworkAttachmentOpt (ep opts.NetworkAttachmentOpts ) (* networktypes .EndpointSettings , error ) {
844+ func parseNetworkAttachmentOpt (ep opts.NetworkAttachmentOpts ) (* network .EndpointSettings , error ) {
845845 if strings .TrimSpace (ep .Target ) == "" {
846846 return nil , errors .New ("no name set for network" )
847847 }
@@ -854,7 +854,7 @@ func parseNetworkAttachmentOpt(ep opts.NetworkAttachmentOpts) (*networktypes.End
854854 }
855855 }
856856
857- epConfig := & networktypes .EndpointSettings {
857+ epConfig := & network .EndpointSettings {
858858 GwPriority : ep .GwPriority ,
859859 }
860860 epConfig .Aliases = append (epConfig .Aliases , ep .Aliases ... )
@@ -866,7 +866,7 @@ func parseNetworkAttachmentOpt(ep opts.NetworkAttachmentOpts) (*networktypes.End
866866 epConfig .Links = ep .Links
867867 }
868868 if ep .IPv4Address != "" || ep .IPv6Address != "" || len (ep .LinkLocalIPs ) > 0 {
869- epConfig .IPAMConfig = & networktypes .EndpointIPAMConfig {
869+ epConfig .IPAMConfig = & network .EndpointIPAMConfig {
870870 IPv4Address : ep .IPv4Address ,
871871 IPv6Address : ep .IPv6Address ,
872872 LinkLocalIPs : ep .LinkLocalIPs ,
0 commit comments