mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
cmd/dockerd: move setting defaults to loadDaemonCliConfig()
Move changes to follow, but this moves the code to a more logical place. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -76,8 +76,6 @@ func NewDaemonCli() *DaemonCli {
|
||||
}
|
||||
|
||||
func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
||||
opts.setDefaultOptions()
|
||||
|
||||
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -92,7 +90,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
||||
|
||||
if opts.Validate {
|
||||
// If config wasn't OK we wouldn't have made it this far.
|
||||
fmt.Fprintln(os.Stderr, "configuration OK")
|
||||
_, _ = fmt.Fprintln(os.Stderr, "configuration OK")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -386,6 +384,8 @@ func shutdownDaemon(d *daemon.Daemon) {
|
||||
}
|
||||
|
||||
func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
|
||||
opts.setDefaultOptions()
|
||||
|
||||
conf := opts.daemonConfig
|
||||
flags := opts.flags
|
||||
conf.Debug = opts.Debug
|
||||
|
||||
Reference in New Issue
Block a user