github.com/endophage/docker@v1.4.2-0.20161027011718-242853499895/runconfig/hostconfig_solaris.go (about)

     1  package runconfig
     2  
     3  import (
     4  	"fmt"
     5  	"strings"
     6  
     7  	"github.com/docker/docker/api/types/container"
     8  	"github.com/docker/docker/pkg/sysinfo"
     9  )
    10  
    11  // DefaultDaemonNetworkMode returns the default network stack the daemon should
    12  // use.
    13  func DefaultDaemonNetworkMode() container.NetworkMode {
    14  	return container.NetworkMode("default")
    15  }
    16  
    17  // IsPreDefinedNetwork indicates if a network is predefined by the daemon
    18  func IsPreDefinedNetwork(network string) bool {
    19  	return false
    20  }
    21  
    22  // ValidateNetMode ensures that the various combinations of requested
    23  // network settings are valid.
    24  func ValidateNetMode(c *container.Config, hc *container.HostConfig) error {
    25  	// We may not be passed a host config, such as in the case of docker commit
    26  	if hc == nil {
    27  		return nil
    28  	}
    29  	parts := strings.Split(string(hc.NetworkMode), ":")
    30  	switch mode := parts[0]; mode {
    31  	case "default", "none":
    32  	default:
    33  		return fmt.Errorf("invalid --net: %s", hc.NetworkMode)
    34  	}
    35  	return nil
    36  }
    37  
    38  // ValidateIsolation performs platform specific validation of the
    39  // isolation level in the hostconfig structure.
    40  // This setting is currently discarded for Solaris so this is a no-op.
    41  func ValidateIsolation(hc *container.HostConfig) error {
    42  	return nil
    43  }
    44  
    45  // ValidateQoS performs platform specific validation of the QoS settings
    46  func ValidateQoS(hc *container.HostConfig) error {
    47  	return nil
    48  }
    49  
    50  // ValidateResources performs platform specific validation of the resource settings
    51  func ValidateResources(hc *container.HostConfig, si *sysinfo.SysInfo) error {
    52  	return nil
    53  }