mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Deprecate '--cluster-xx' options and add warning
Co-authored-by: Yves Brissaud <yves.brissaud@gmail.com> Signed-off-by: Anca Iordache <anca.iordache@docker.com>
This commit is contained in:
parent
58c2615208
commit
1470697b67
2 changed files with 18 additions and 0 deletions
|
@ -68,9 +68,14 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) error {
|
|||
flags.Var(opts.NewNamedListOptsRef("labels", &conf.Labels, opts.ValidateLabel), "label", "Set key=value labels to the daemon")
|
||||
flags.StringVar(&conf.LogConfig.Type, "log-driver", "json-file", "Default driver for container logs")
|
||||
flags.Var(opts.NewNamedMapOpts("log-opts", conf.LogConfig.Config, nil), "log-opt", "Default log driver options for containers")
|
||||
|
||||
flags.StringVar(&conf.ClusterAdvertise, "cluster-advertise", "", "Address or interface name to advertise")
|
||||
_ = flags.MarkDeprecated("cluster-advertise", "Deprecated option.")
|
||||
flags.StringVar(&conf.ClusterStore, "cluster-store", "", "URL of the distributed storage backend")
|
||||
_ = flags.MarkDeprecated("cluster-store", "Deprecated option.")
|
||||
flags.Var(opts.NewNamedMapOpts("cluster-store-opts", conf.ClusterOpts, nil), "cluster-store-opt", "Set cluster store options")
|
||||
_ = flags.MarkDeprecated("cluster-store-opts", "Deprecated option.")
|
||||
|
||||
flags.StringVar(&conf.CorsHeaders, "api-cors-header", "", "Set CORS headers in the Engine API")
|
||||
flags.IntVar(&maxConcurrentDownloads, "max-concurrent-downloads", config.DefaultMaxConcurrentDownloads, "Set the max concurrent downloads for each pull")
|
||||
flags.IntVar(&maxConcurrentUploads, "max-concurrent-uploads", config.DefaultMaxConcurrentUploads, "Set the max concurrent uploads for each push")
|
||||
|
|
|
@ -85,6 +85,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
|||
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
|
||||
return err
|
||||
}
|
||||
warnOnDeprecatedConfigOptions(cli.Config)
|
||||
|
||||
if err := configureDaemonLogs(cli.Config); err != nil {
|
||||
return err
|
||||
|
@ -469,6 +470,18 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
|
|||
return conf, nil
|
||||
}
|
||||
|
||||
func warnOnDeprecatedConfigOptions(config *config.Config) {
|
||||
if config.ClusterAdvertise != "" {
|
||||
logrus.Warn(`The "cluster-advertise" option is deprecated. To be removed soon.`)
|
||||
}
|
||||
if config.ClusterStore != "" {
|
||||
logrus.Warn(`The "cluster-store" option is deprecated. To be removed soon.`)
|
||||
}
|
||||
if len(config.ClusterOpts) > 0 {
|
||||
logrus.Warn(`The "cluster-store-opt" option is deprecated. To be removed soon.`)
|
||||
}
|
||||
}
|
||||
|
||||
func initRouter(opts routerOptions) {
|
||||
decoder := runconfig.ContainerDecoder{}
|
||||
|
||||
|
|
Loading…
Reference in a new issue