@@ -16,8 +16,8 @@ import (
16
16
"github.com/docker/cli/internal/lazyregexp"
17
17
"github.com/docker/cli/opts"
18
18
"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"
21
21
"github.com/docker/go-connections/nat"
22
22
"github.com/pkg/errors"
23
23
"github.com/spf13/pflag"
@@ -323,7 +323,7 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
323
323
type containerConfig struct {
324
324
Config * container.Config
325
325
HostConfig * container.HostConfig
326
- NetworkingConfig * networktypes .NetworkingConfig
326
+ NetworkingConfig * network .NetworkingConfig
327
327
}
328
328
329
329
// 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
372
372
if parsed .Source != "" {
373
373
toBind := bind
374
374
375
- if parsed .Type == string (mounttypes .TypeBind ) {
375
+ if parsed .Type == string (mount .TypeBind ) {
376
376
if hostPart , targetPath , ok := strings .Cut (bind , ":" ); ok {
377
377
if ! filepath .IsAbs (hostPart ) && strings .HasPrefix (hostPart , "." ) {
378
378
if absHostPart , err := filepath .Abs (hostPart ); err == nil {
@@ -706,8 +706,8 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
706
706
config .StdinOnce = true
707
707
}
708
708
709
- networkingConfig := & networktypes .NetworkingConfig {
710
- EndpointsConfig : make (map [string ]* networktypes .EndpointSettings ),
709
+ networkingConfig := & network .NetworkingConfig {
710
+ EndpointsConfig : make (map [string ]* network .EndpointSettings ),
711
711
}
712
712
713
713
networkingConfig .EndpointsConfig , err = parseNetworkOpts (copts )
@@ -735,9 +735,9 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
735
735
// this function may return _multiple_ endpoints, which is not currently supported
736
736
// by the daemon, but may be in future; it's up to the daemon to produce an error
737
737
// 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 ) {
739
739
var (
740
- endpoints = make (map [string ]* networktypes .EndpointSettings , len (copts .netMode .Value ()))
740
+ endpoints = make (map [string ]* network .EndpointSettings , len (copts .netMode .Value ()))
741
741
hasUserDefined , hasNonUserDefined bool
742
742
)
743
743
@@ -783,7 +783,7 @@ func parseNetworkOpts(copts *containerOptions) (map[string]*networktypes.Endpoin
783
783
// and only a single network is specified, omit the endpoint-configuration
784
784
// on the client (the daemon will still create it when creating the container)
785
785
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 {}) {
787
787
continue
788
788
}
789
789
}
@@ -841,7 +841,7 @@ func applyContainerOptions(n *opts.NetworkAttachmentOpts, copts *containerOption
841
841
return nil
842
842
}
843
843
844
- func parseNetworkAttachmentOpt (ep opts.NetworkAttachmentOpts ) (* networktypes .EndpointSettings , error ) {
844
+ func parseNetworkAttachmentOpt (ep opts.NetworkAttachmentOpts ) (* network .EndpointSettings , error ) {
845
845
if strings .TrimSpace (ep .Target ) == "" {
846
846
return nil , errors .New ("no name set for network" )
847
847
}
@@ -854,7 +854,7 @@ func parseNetworkAttachmentOpt(ep opts.NetworkAttachmentOpts) (*networktypes.End
854
854
}
855
855
}
856
856
857
- epConfig := & networktypes .EndpointSettings {
857
+ epConfig := & network .EndpointSettings {
858
858
GwPriority : ep .GwPriority ,
859
859
}
860
860
epConfig .Aliases = append (epConfig .Aliases , ep .Aliases ... )
@@ -866,7 +866,7 @@ func parseNetworkAttachmentOpt(ep opts.NetworkAttachmentOpts) (*networktypes.End
866
866
epConfig .Links = ep .Links
867
867
}
868
868
if ep .IPv4Address != "" || ep .IPv6Address != "" || len (ep .LinkLocalIPs ) > 0 {
869
- epConfig .IPAMConfig = & networktypes .EndpointIPAMConfig {
869
+ epConfig .IPAMConfig = & network .EndpointIPAMConfig {
870
870
IPv4Address : ep .IPv4Address ,
871
871
IPv6Address : ep .IPv6Address ,
872
872
LinkLocalIPs : ep .LinkLocalIPs ,
0 commit comments