github.com/moby/docker@v26.1.3+incompatible/runconfig/errors.go (about)

     1  package runconfig // import "github.com/docker/docker/runconfig"
     2  
     3  const (
     4  	// ErrConflictContainerNetworkAndLinks conflict between --net=container and links
     5  	ErrConflictContainerNetworkAndLinks validationError = "conflicting options: container type network can't be used with links. This would result in undefined behavior"
     6  	// ErrConflictSharedNetwork conflict between private and other networks
     7  	ErrConflictSharedNetwork validationError = "container sharing network namespace with another container or host cannot be connected to any other network"
     8  	// ErrConflictHostNetwork conflict from being disconnected from host network or connected to host network.
     9  	ErrConflictHostNetwork validationError = "container cannot be disconnected from host network or connected to host network"
    10  	// ErrConflictNoNetwork conflict between private and other networks
    11  	ErrConflictNoNetwork validationError = "container cannot be connected to multiple networks with one of the networks in private (none) mode"
    12  	// ErrConflictNetworkAndDNS conflict between --dns and the network mode
    13  	ErrConflictNetworkAndDNS validationError = "conflicting options: dns and the network mode"
    14  	// ErrConflictNetworkHostname conflict between the hostname and the network mode
    15  	ErrConflictNetworkHostname validationError = "conflicting options: hostname and the network mode"
    16  	// ErrConflictHostNetworkAndLinks conflict between --net=host and links
    17  	ErrConflictHostNetworkAndLinks validationError = "conflicting options: host type networking can't be used with links. This would result in undefined behavior"
    18  	// ErrConflictContainerNetworkAndMac conflict between the mac address and the network mode
    19  	ErrConflictContainerNetworkAndMac validationError = "conflicting options: mac-address and the network mode"
    20  	// ErrConflictNetworkHosts conflict between add-host and the network mode
    21  	ErrConflictNetworkHosts validationError = "conflicting options: custom host-to-IP mapping and the network mode"
    22  	// ErrConflictNetworkPublishPorts conflict between the publish options and the network mode
    23  	ErrConflictNetworkPublishPorts validationError = "conflicting options: port publishing and the container type network mode"
    24  	// ErrConflictNetworkExposePorts conflict between the expose option and the network mode
    25  	ErrConflictNetworkExposePorts validationError = "conflicting options: port exposing and the container type network mode"
    26  	// ErrUnsupportedNetworkAndIP conflict between network mode and requested ip address
    27  	ErrUnsupportedNetworkAndIP validationError = "user specified IP address is supported on user defined networks only"
    28  	// ErrUnsupportedNetworkNoSubnetAndIP conflict between network with no configured subnet and requested ip address
    29  	ErrUnsupportedNetworkNoSubnetAndIP validationError = "user specified IP address is supported only when connecting to networks with user configured subnets"
    30  	// ErrUnsupportedNetworkAndAlias conflict between network mode and alias
    31  	ErrUnsupportedNetworkAndAlias validationError = "network-scoped alias is supported only for containers in user defined networks"
    32  	// ErrConflictUTSHostname conflict between the hostname and the UTS mode
    33  	ErrConflictUTSHostname validationError = "conflicting options: hostname and the UTS mode"
    34  	// ErrEmptyConfig when container config is nil
    35  	ErrEmptyConfig validationError = "config cannot be empty in order to create a container"
    36  )
    37  
    38  type validationError string
    39  
    40  func (e validationError) Error() string {
    41  	return string(e)
    42  }
    43  
    44  func (e validationError) InvalidParameter() {}
    45  
    46  type invalidJSONError struct {
    47  	Err error
    48  }
    49  
    50  func (e invalidJSONError) Error() string {
    51  	return "invalid JSON: " + e.Err.Error()
    52  }
    53  
    54  func (e invalidJSONError) Unwrap() error {
    55  	return e.Err
    56  }
    57  
    58  func (e invalidJSONError) InvalidParameter() {}