errors.go 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package runconfig
  2. import (
  3. "fmt"
  4. "github.com/docker/docker/api/errors"
  5. )
  6. var (
  7. // ErrConflictContainerNetworkAndLinks conflict between --net=container and links
  8. ErrConflictContainerNetworkAndLinks = fmt.Errorf("Conflicting options: container type network can't be used with links. This would result in undefined behavior")
  9. // ErrConflictUserDefinedNetworkAndLinks conflict between --net=<NETWORK> and links
  10. ErrConflictUserDefinedNetworkAndLinks = fmt.Errorf("Conflicting options: networking can't be used with links. This would result in undefined behavior")
  11. // ErrConflictSharedNetwork conflict between private and other networks
  12. ErrConflictSharedNetwork = fmt.Errorf("Container sharing network namespace with another container or host cannot be connected to any other network")
  13. // ErrConflictHostNetwork conflict from being disconnected from host network or connected to host network.
  14. ErrConflictHostNetwork = fmt.Errorf("Container cannot be disconnected from host network or connected to host network")
  15. // ErrConflictNoNetwork conflict between private and other networks
  16. ErrConflictNoNetwork = fmt.Errorf("Container cannot be connected to multiple networks with one of the networks in private (none) mode")
  17. // ErrConflictNetworkAndDNS conflict between --dns and the network mode
  18. ErrConflictNetworkAndDNS = fmt.Errorf("Conflicting options: dns and the network mode")
  19. // ErrConflictNetworkHostname conflict between the hostname and the network mode
  20. ErrConflictNetworkHostname = fmt.Errorf("Conflicting options: hostname and the network mode")
  21. // ErrConflictHostNetworkAndLinks conflict between --net=host and links
  22. ErrConflictHostNetworkAndLinks = fmt.Errorf("Conflicting options: host type networking can't be used with links. This would result in undefined behavior")
  23. // ErrConflictContainerNetworkAndMac conflict between the mac address and the network mode
  24. ErrConflictContainerNetworkAndMac = fmt.Errorf("Conflicting options: mac-address and the network mode")
  25. // ErrConflictNetworkHosts conflict between add-host and the network mode
  26. ErrConflictNetworkHosts = fmt.Errorf("Conflicting options: custom host-to-IP mapping and the network mode")
  27. // ErrConflictNetworkPublishPorts conflict between the publish options and the network mode
  28. ErrConflictNetworkPublishPorts = fmt.Errorf("Conflicting options: port publishing and the container type network mode")
  29. // ErrConflictNetworkExposePorts conflict between the expose option and the network mode
  30. ErrConflictNetworkExposePorts = fmt.Errorf("Conflicting options: port exposing and the container type network mode")
  31. // ErrUnsupportedNetworkAndIP conflict between network mode and requested ip address
  32. ErrUnsupportedNetworkAndIP = fmt.Errorf("User specified IP address is supported on user defined networks only")
  33. // ErrUnsupportedNetworkNoSubnetAndIP conflict between network with no configured subnet and requested ip address
  34. ErrUnsupportedNetworkNoSubnetAndIP = fmt.Errorf("User specified IP address is supported only when connecting to networks with user configured subnets")
  35. // ErrUnsupportedNetworkAndAlias conflict between network mode and alias
  36. ErrUnsupportedNetworkAndAlias = fmt.Errorf("Network-scoped alias is supported only for containers in user defined networks")
  37. // ErrConflictUTSHostname conflict between the hostname and the UTS mode
  38. ErrConflictUTSHostname = fmt.Errorf("Conflicting options: hostname and the UTS mode")
  39. )
  40. func conflictError(err error) error {
  41. return errors.NewRequestConflictError(err)
  42. }