mirror of https://github.com/docker/docs.git
Merge pull request #5709 from vieux/conflict_h_net
returns an error when using -h and --net
This commit is contained in:
commit
da0686481c
|
@ -17,6 +17,7 @@ var (
|
||||||
ErrInvalidWorkingDirectory = fmt.Errorf("The working directory is invalid. It needs to be an absolute path.")
|
ErrInvalidWorkingDirectory = fmt.Errorf("The working directory is invalid. It needs to be an absolute path.")
|
||||||
ErrConflictAttachDetach = fmt.Errorf("Conflicting options: -a and -d")
|
ErrConflictAttachDetach = fmt.Errorf("Conflicting options: -a and -d")
|
||||||
ErrConflictDetachAutoRemove = fmt.Errorf("Conflicting options: --rm and -d")
|
ErrConflictDetachAutoRemove = fmt.Errorf("Conflicting options: --rm and -d")
|
||||||
|
ErrConflictNetworkHostname = fmt.Errorf("Conflicting options: -h and --net")
|
||||||
)
|
)
|
||||||
|
|
||||||
//FIXME Only used in tests
|
//FIXME Only used in tests
|
||||||
|
@ -101,6 +102,10 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
|
||||||
return nil, nil, cmd, ErrConflictDetachAutoRemove
|
return nil, nil, cmd, ErrConflictDetachAutoRemove
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *flNetMode != "bridge" && *flHostname != "" {
|
||||||
|
return nil, nil, cmd, ErrConflictNetworkHostname
|
||||||
|
}
|
||||||
|
|
||||||
// If neither -d or -a are set, attach to everything by default
|
// If neither -d or -a are set, attach to everything by default
|
||||||
if flAttach.Len() == 0 && !*flDetach {
|
if flAttach.Len() == 0 && !*flDetach {
|
||||||
if !*flDetach {
|
if !*flDetach {
|
||||||
|
|
Loading…
Reference in New Issue