daemon/config: reorganize code between unix and windows files
Put variables and functions in the same owrder between both, to allow for easier comparing between platforms. Also synchronised some comments/godoc between both. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c81abefdb1
commit
a65f83317c
|
@ -15,6 +15,25 @@ const (
|
||||||
DefaultIpcMode = "private"
|
DefaultIpcMode = "private"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// BridgeConfig stores all the bridge driver specific
|
||||||
|
// configuration.
|
||||||
|
type BridgeConfig struct {
|
||||||
|
commonBridgeConfig
|
||||||
|
|
||||||
|
// These fields are common to all unix platforms.
|
||||||
|
commonUnixBridgeConfig
|
||||||
|
|
||||||
|
// Fields below here are platform specific.
|
||||||
|
EnableIPv6 bool `json:"ipv6,omitempty"`
|
||||||
|
EnableIPTables bool `json:"iptables,omitempty"`
|
||||||
|
EnableIP6Tables bool `json:"ip6tables,omitempty"`
|
||||||
|
EnableIPForward bool `json:"ip-forward,omitempty"`
|
||||||
|
EnableIPMasq bool `json:"ip-masq,omitempty"`
|
||||||
|
EnableUserlandProxy bool `json:"userland-proxy,omitempty"`
|
||||||
|
UserlandProxyPath string `json:"userland-proxy-path,omitempty"`
|
||||||
|
FixedCIDRv6 string `json:"fixed-cidr-v6,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Config defines the configuration of a docker daemon.
|
// Config defines the configuration of a docker daemon.
|
||||||
// It includes json tags to deserialize configuration from a file
|
// It includes json tags to deserialize configuration from a file
|
||||||
// using the same names that the flags in the command line uses.
|
// using the same names that the flags in the command line uses.
|
||||||
|
@ -43,25 +62,6 @@ type Config struct {
|
||||||
Rootless bool `json:"rootless,omitempty"`
|
Rootless bool `json:"rootless,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// BridgeConfig stores all the bridge driver specific
|
|
||||||
// configuration.
|
|
||||||
type BridgeConfig struct {
|
|
||||||
commonBridgeConfig
|
|
||||||
|
|
||||||
// These fields are common to all unix platforms.
|
|
||||||
commonUnixBridgeConfig
|
|
||||||
|
|
||||||
// Fields below here are platform specific.
|
|
||||||
EnableIPv6 bool `json:"ipv6,omitempty"`
|
|
||||||
EnableIPTables bool `json:"iptables,omitempty"`
|
|
||||||
EnableIP6Tables bool `json:"ip6tables,omitempty"`
|
|
||||||
EnableIPForward bool `json:"ip-forward,omitempty"`
|
|
||||||
EnableIPMasq bool `json:"ip-masq,omitempty"`
|
|
||||||
EnableUserlandProxy bool `json:"userland-proxy,omitempty"`
|
|
||||||
UserlandProxyPath string `json:"userland-proxy-path,omitempty"`
|
|
||||||
FixedCIDRv6 string `json:"fixed-cidr-v6,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSwarmCompatible defines if swarm mode can be enabled in this config
|
// IsSwarmCompatible defines if swarm mode can be enabled in this config
|
||||||
func (conf *Config) IsSwarmCompatible() error {
|
func (conf *Config) IsSwarmCompatible() error {
|
||||||
if conf.ClusterStore != "" || conf.ClusterAdvertise != "" {
|
if conf.ClusterStore != "" || conf.ClusterAdvertise != "" {
|
||||||
|
@ -104,7 +104,7 @@ func (conf *Config) ValidatePlatformConfig() error {
|
||||||
return verifyDefaultCgroupNsMode(conf.CgroupNamespaceMode)
|
return verifyDefaultCgroupNsMode(conf.CgroupNamespaceMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsRootless returns conf.Rootless
|
// IsRootless returns conf.Rootless on Linux but false on Windows
|
||||||
func (conf *Config) IsRootless() bool {
|
func (conf *Config) IsRootless() bool {
|
||||||
return conf.Rootless
|
return conf.Rootless
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ type BridgeConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config defines the configuration of a docker daemon.
|
// Config defines the configuration of a docker daemon.
|
||||||
// These are the configuration settings that you pass
|
// It includes json tags to deserialize configuration from a file
|
||||||
// to the docker daemon when you launch it with say: `dockerd -e windows`
|
// using the same names that the flags in the command line uses.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
CommonConfig
|
CommonConfig
|
||||||
|
|
||||||
|
@ -26,11 +26,6 @@ func (conf *Config) GetRuntime(name string) *types.Runtime {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInitPath returns the configure docker-init path
|
|
||||||
func (conf *Config) GetInitPath() string {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDefaultRuntimeName returns the current default runtime
|
// GetDefaultRuntimeName returns the current default runtime
|
||||||
func (conf *Config) GetDefaultRuntimeName() string {
|
func (conf *Config) GetDefaultRuntimeName() string {
|
||||||
return StockRuntimeName
|
return StockRuntimeName
|
||||||
|
@ -46,6 +41,11 @@ func (conf *Config) GetExecRoot() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetInitPath returns the configured docker-init path
|
||||||
|
func (conf *Config) GetInitPath() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// IsSwarmCompatible defines if swarm mode can be enabled in this config
|
// IsSwarmCompatible defines if swarm mode can be enabled in this config
|
||||||
func (conf *Config) IsSwarmCompatible() error {
|
func (conf *Config) IsSwarmCompatible() error {
|
||||||
return nil
|
return nil
|
||||||
|
@ -56,7 +56,7 @@ func (conf *Config) ValidatePlatformConfig() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsRootless returns conf.Rootless on Unix but false on Windows
|
// IsRootless returns conf.Rootless on Linux but false on Windows
|
||||||
func (conf *Config) IsRootless() bool {
|
func (conf *Config) IsRootless() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue