mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
31bf9ca0c8
Cleanup cobra integration Update windows files for cobra and pflags Cleanup SetupRootcmd, and remove unnecessary SetFlagErrorFunc. Use cobra command traversal Signed-off-by: Daniel Nephin <dnephin@docker.com>
65 lines
1.9 KiB
Go
65 lines
1.9 KiB
Go
package daemon
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/docker/engine-api/types"
|
|
"github.com/spf13/pflag"
|
|
)
|
|
|
|
var (
|
|
defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
|
|
defaultGraph = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
|
|
)
|
|
|
|
// bridgeConfig stores all the bridge driver specific
|
|
// configuration.
|
|
type bridgeConfig struct {
|
|
commonBridgeConfig
|
|
}
|
|
|
|
// Config defines the configuration of a docker daemon.
|
|
// These are the configuration settings that you pass
|
|
// to the docker daemon when you launch it with say: `docker daemon -e windows`
|
|
type Config struct {
|
|
CommonConfig
|
|
|
|
// Fields below here are platform specific. (There are none presently
|
|
// for the Windows daemon.)
|
|
}
|
|
|
|
// InstallFlags adds flags to the pflag.FlagSet to configure the daemon
|
|
func (config *Config) InstallFlags(flags *pflag.FlagSet) {
|
|
// First handle install flags which are consistent cross-platform
|
|
config.InstallCommonFlags(flags)
|
|
|
|
// Then platform-specific install flags.
|
|
flags.StringVar(&config.bridgeConfig.FixedCIDR, "fixed-cidr", "", "IPv4 subnet for fixed IPs")
|
|
flags.StringVarP(&config.bridgeConfig.Iface, "bridge", "b", "", "Attach containers to a virtual switch")
|
|
flags.StringVarP(&config.SocketGroup, "group", "G", "", "Users or groups that can access the named pipe")
|
|
}
|
|
|
|
// GetRuntime returns the runtime path and arguments for a given
|
|
// runtime name
|
|
func (config *Config) GetRuntime(name string) *types.Runtime {
|
|
return nil
|
|
}
|
|
|
|
// GetDefaultRuntimeName returns the current default runtime
|
|
func (config *Config) GetDefaultRuntimeName() string {
|
|
return stockRuntimeName
|
|
}
|
|
|
|
// GetAllRuntimes returns a copy of the runtimes map
|
|
func (config *Config) GetAllRuntimes() map[string]types.Runtime {
|
|
return map[string]types.Runtime{}
|
|
}
|
|
|
|
// GetExecRoot returns the user configured Exec-root
|
|
func (config *Config) GetExecRoot() string {
|
|
return ""
|
|
}
|
|
|
|
func (config *Config) isSwarmCompatible() error {
|
|
return nil
|
|
}
|