MCPcopy
hub / github.com/NVIDIA/aistore / _config

Method _config

ais/earlystart.go:383–415  ·  view source on GitHub ↗

NOTE: `-override_backends` option (cli.overrideBackends)

(uuid string)

Source from the content-addressed store, hash-verified

381
382// NOTE: `-override_backends` option (cli.overrideBackends)
383func (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
417func (p *proxy) initClusterConfig(uuid string) (config *globalConfig, err error) {
418 debug.Assert(p.owner.smap.get().isPrimary(p.si))

Callers 1

primaryStartupMethod · 0.95

Calls 8

initClusterConfigMethod · 0.95
LoadFunction · 0.92
PlainFunction · 0.92
GetInitialGconfPathMethod · 0.80
EqualCloudsMethod · 0.80
versionMethod · 0.65
getMethod · 0.65
modifyMethod · 0.65

Tested by

no test coverage detected