MM-45875: Apply environment overrides in cluster scenario (#20694)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2022-07-25 15:23:14 +05:30
коммит произвёл GitHub
родитель fa9477d332
Коммит 07623a70fd

Просмотреть файл

@@ -184,6 +184,11 @@ func (s *Store) Set(newCfg *model.Config) (*model.Config, *model.Config, error)
// data from the existing config as necessary.
desanitize(oldCfg, newCfg)
// We apply back environment overrides since the input config may or
// may not have them applied.
newCfg = applyEnvironmentMap(newCfg, GetEnvironment())
fixConfig(newCfg)
if err := newCfg.IsValid(); err != nil {
return nil, nil, errors.Wrap(err, "new configuration is invalid")
}
@@ -209,14 +214,6 @@ func (s *Store) Set(newCfg *model.Config) (*model.Config, *model.Config, error)
return nil, nil, errors.Wrap(err, "failed to persist")
}
// We apply back environment overrides since the input config may or
// may not have them applied.
newCfg = applyEnvironmentMap(newCfgNoEnv, GetEnvironment())
fixConfig(newCfg)
if err := newCfg.IsValid(); err != nil {
return nil, nil, errors.Wrap(err, "new configuration is invalid")
}
hasChanged, err := equal(oldCfg, newCfg)
if err != nil {
return nil, nil, errors.Wrap(err, "failed to compare configs")