NOTE: `-override_backends` option (cli.overrideBackends)
(uuid string)
| 381 | |
| 382 | // NOTE: `-override_backends` option (cli.overrideBackends) |
| 383 | func (p *proxy) _config(uuid string) (config *globalConfig, err error) { |
| 384 | var ( |
| 385 | c cmn.ClusterConfig |
| 386 | confPath string |
| 387 | ) |
| 388 | if p.owner.config.version() == 0 { |
| 389 | config, err = p.initClusterConfig(uuid) |
| 390 | return |
| 391 | } |
| 392 | config, err = p.owner.config.get() |
| 393 | if !daemon.cli.overrideBackends { |
| 394 | return |
| 395 | } |
| 396 | // load plain-text backends and compare |
| 397 | confPath = cmn.GCO.GetInitialGconfPath() |
| 398 | _, err = jsp.Load(confPath, &c, jsp.Plain()) |
| 399 | if err != nil { |
| 400 | return |
| 401 | } |
| 402 | if c.Backend.EqualClouds(&config.Backend) { |
| 403 | return |
| 404 | } |
| 405 | // NOTE: primary command-line flag `-override_backends` allows to choose |
| 406 | // Cloud providers (and HDFS) at deployment time |
| 407 | config, err = p.owner.config.modify(&configModifier{ |
| 408 | pre: func(ctx *configModifier, clone *globalConfig) (updated bool, err error) { |
| 409 | clone.Backend.Conf = c.Backend.Conf |
| 410 | updated = true |
| 411 | return |
| 412 | }, |
| 413 | }) |
| 414 | return |
| 415 | } |
| 416 | |
| 417 | func (p *proxy) initClusterConfig(uuid string) (config *globalConfig, err error) { |
| 418 | debug.Assert(p.owner.smap.get().isPrimary(p.si)) |
no test coverage detected