# Load the defaults, used by config:migrate and fallback loading
# legacy application.yml
-Open3.popen2("arvados-server", "config-dump", "-config=-") do |stdin, stdout, status_thread|
+Open3.popen2("arvados-server", "config-dump", "-config=-", "-skip-legacy") do |stdin, stdout, status_thread|
stdin.write("Clusters: {xxxxx: {}}")
stdin.close
confs = YAML.load(stdout, deserialize_symbols: false)
end
# Load the global config file
-Open3.popen2("arvados-server", "config-dump") do |stdin, stdout, status_thread|
+Open3.popen2("arvados-server", "config-dump", "-skip-legacy") do |stdin, stdout, status_thread|
confs = YAML.load(stdout, deserialize_symbols: false)
if confs && !confs.empty?
# config-dump merges defaults with user configuration, so every
// such that the deprecated keys/files are superfluous and can
// be deleted.
loader.SkipDeprecated = true
+ loader.SkipLegacy = true
withoutDepr, err := loader.Load()
if err != nil {
return 1
}
loader.SkipDeprecated = false
+ loader.SkipLegacy = false
withDepr, err := loader.Load()
if err != nil {
return 1
// update config using values from an old-style keepstore config file.
func (ldr *Loader) loadOldKeepstoreConfig(cfg *arvados.Config) error {
+ if ldr.KeepstorePath == "" {
+ return nil
+ }
var oc oldKeepstoreConfig
err := ldr.loadOldConfigHelper("keepstore", ldr.KeepstorePath, &oc)
if os.IsNotExist(err) && (ldr.KeepstorePath == defaultKeepstoreConfigPath) {
// update config using values from an crunch-dispatch-slurm config file.
func (ldr *Loader) loadOldCrunchDispatchSlurmConfig(cfg *arvados.Config) error {
+ if ldr.CrunchDispatchSlurmPath == "" {
+ return nil
+ }
var oc oldCrunchDispatchSlurmConfig
err := ldr.loadOldConfigHelper("crunch-dispatch-slurm", ldr.CrunchDispatchSlurmPath, &oc)
if os.IsNotExist(err) && (ldr.CrunchDispatchSlurmPath == defaultCrunchDispatchSlurmConfigPath) {
// update config using values from an crunch-dispatch-slurm config file.
func (ldr *Loader) loadOldWebsocketConfig(cfg *arvados.Config) error {
+ if ldr.WebsocketPath == "" {
+ return nil
+ }
var oc oldWsConfig
err := ldr.loadOldConfigHelper("arvados-ws", ldr.WebsocketPath, &oc)
if os.IsNotExist(err) && ldr.WebsocketPath == defaultWebsocketConfigPath {
type Loader struct {
Stdin io.Reader
Logger logrus.FieldLogger
- SkipDeprecated bool // Don't load legacy/deprecated config keys/files
+ SkipDeprecated bool // Don't load deprecated config keys
+ SkipLegacy bool // Don't load legacy config files
Path string
KeepstorePath string
flagset.StringVar(&ldr.KeepstorePath, "legacy-keepstore-config", defaultKeepstoreConfigPath, "Legacy keepstore configuration `file`")
flagset.StringVar(&ldr.CrunchDispatchSlurmPath, "legacy-crunch-dispatch-slurm-config", defaultCrunchDispatchSlurmConfigPath, "Legacy crunch-dispatch-slurm configuration `file`")
flagset.StringVar(&ldr.WebsocketPath, "legacy-ws-config", defaultWebsocketConfigPath, "Legacy arvados-ws configuration `file`")
+ flagset.BoolVar(&ldr.SkipLegacy, "skip-legacy", false, "Don't load legacy config files")
}
// MungeLegacyConfigArgs checks args for a -config flag whose argument
}
}
}
+
+ // Disable legacy config loading for components other than the
+ // one that was specified
+ if legacyConfigArg != "-legacy-keepstore-config" {
+ ldr.KeepstorePath = ""
+ }
+ if legacyConfigArg != "-legacy-crunch-dispatch-slurm-config" {
+ ldr.CrunchDispatchSlurmPath = ""
+ }
+ if legacyConfigArg != "-legacy-ws-config" {
+ ldr.WebsocketPath = ""
+ }
+
return munged
}
if err != nil {
return nil, err
}
+ }
+ if !ldr.SkipLegacy {
// legacy file is required when either:
// * a non-default location was specified
// * no primary config was loaded, and this is the
# Load the defaults, used by config:migrate and fallback loading
# legacy application.yml
-Open3.popen2("arvados-server", "config-dump", "-config=-") do |stdin, stdout, status_thread|
+Open3.popen2("arvados-server", "config-dump", "-config=-", "-skip-legacy") do |stdin, stdout, status_thread|
stdin.write("Clusters: {xxxxx: {}}")
stdin.close
confs = YAML.load(stdout, deserialize_symbols: false)
end
# Load the global config file
-Open3.popen2("arvados-server", "config-dump") do |stdin, stdout, status_thread|
+Open3.popen2("arvados-server", "config-dump", "-skip-legacy") do |stdin, stdout, status_thread|
confs = YAML.load(stdout, deserialize_symbols: false)
if confs && !confs.empty?
# config-dump merges defaults with user configuration, so every