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:
Sebastiaan van Stijn
2022-06-05 21:05:15 +02:00
parent 717a503590
commit 0281f50efa

View File

@@ -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