2018-02-05 21:05:59 +00:00
package runconfig // import "github.com/docker/docker/runconfig"
2015-12-22 01:05:55 +00:00
2017-07-19 14:20:13 +00:00
const (
2015-12-22 01:05:55 +00:00
// ErrConflictContainerNetworkAndLinks conflict between --net=container and links
2017-07-19 14:20:13 +00:00
ErrConflictContainerNetworkAndLinks validationError = "conflicting options: container type network can't be used with links. This would result in undefined behavior"
2015-12-22 01:05:55 +00:00
// ErrConflictSharedNetwork conflict between private and other networks
2017-07-19 14:20:13 +00:00
ErrConflictSharedNetwork validationError = "container sharing network namespace with another container or host cannot be connected to any other network"
2015-12-22 01:05:55 +00:00
// ErrConflictHostNetwork conflict from being disconnected from host network or connected to host network.
2017-07-19 14:20:13 +00:00
ErrConflictHostNetwork validationError = "container cannot be disconnected from host network or connected to host network"
2015-12-22 01:05:55 +00:00
// ErrConflictNoNetwork conflict between private and other networks
2017-07-19 14:20:13 +00:00
ErrConflictNoNetwork validationError = "container cannot be connected to multiple networks with one of the networks in private (none) mode"
2015-12-22 01:05:55 +00:00
// ErrConflictNetworkAndDNS conflict between --dns and the network mode
2017-07-19 14:20:13 +00:00
ErrConflictNetworkAndDNS validationError = "conflicting options: dns and the network mode"
2015-12-22 01:05:55 +00:00
// ErrConflictNetworkHostname conflict between the hostname and the network mode
2017-07-19 14:20:13 +00:00
ErrConflictNetworkHostname validationError = "conflicting options: hostname and the network mode"
2015-12-22 01:05:55 +00:00
// ErrConflictHostNetworkAndLinks conflict between --net=host and links
2017-07-19 14:20:13 +00:00
ErrConflictHostNetworkAndLinks validationError = "conflicting options: host type networking can't be used with links. This would result in undefined behavior"
2015-12-22 01:05:55 +00:00
// ErrConflictContainerNetworkAndMac conflict between the mac address and the network mode
2017-07-19 14:20:13 +00:00
ErrConflictContainerNetworkAndMac validationError = "conflicting options: mac-address and the network mode"
2015-12-22 01:05:55 +00:00
// ErrConflictNetworkHosts conflict between add-host and the network mode
2017-07-19 14:20:13 +00:00
ErrConflictNetworkHosts validationError = "conflicting options: custom host-to-IP mapping and the network mode"
2015-12-22 01:05:55 +00:00
// ErrConflictNetworkPublishPorts conflict between the publish options and the network mode
2017-07-19 14:20:13 +00:00
ErrConflictNetworkPublishPorts validationError = "conflicting options: port publishing and the container type network mode"
2015-12-22 01:05:55 +00:00
// ErrConflictNetworkExposePorts conflict between the expose option and the network mode
2017-07-19 14:20:13 +00:00
ErrConflictNetworkExposePorts validationError = "conflicting options: port exposing and the container type network mode"
2016-01-26 15:13:26 +00:00
// ErrUnsupportedNetworkAndIP conflict between network mode and requested ip address
2017-07-19 14:20:13 +00:00
ErrUnsupportedNetworkAndIP validationError = "user specified IP address is supported on user defined networks only"
2016-01-26 15:13:26 +00:00
// ErrUnsupportedNetworkNoSubnetAndIP conflict between network with no configured subnet and requested ip address
2017-07-19 14:20:13 +00:00
ErrUnsupportedNetworkNoSubnetAndIP validationError = "user specified IP address is supported only when connecting to networks with user configured subnets"
2016-01-08 13:45:56 +00:00
// ErrUnsupportedNetworkAndAlias conflict between network mode and alias
2017-07-19 14:20:13 +00:00
ErrUnsupportedNetworkAndAlias validationError = "network-scoped alias is supported only for containers in user defined networks"
2016-03-10 01:40:12 +00:00
// ErrConflictUTSHostname conflict between the hostname and the UTS mode
2017-07-19 14:20:13 +00:00
ErrConflictUTSHostname validationError = "conflicting options: hostname and the UTS mode"
2023-10-25 12:43:59 +00:00
// ErrEmptyConfig when container config is nil
2023-10-25 15:34:20 +00:00
ErrEmptyConfig validationError = "config cannot be empty in order to create a container"
2015-12-22 01:05:55 +00:00
)
2017-07-19 14:20:13 +00:00
type validationError string
func ( e validationError ) Error ( ) string {
return string ( e )
}
func ( e validationError ) InvalidParameter ( ) { }
2023-05-17 19:45:59 +00:00
type invalidJSONError struct {
Err error
}
func ( e invalidJSONError ) Error ( ) string {
return "invalid JSON: " + e . Err . Error ( )
}
func ( e invalidJSONError ) Unwrap ( ) error {
return e . Err
}
func ( e invalidJSONError ) InvalidParameter ( ) { }