MM-45875: Apply environment overrides in cluster scenario (#20694)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
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.
|
// data from the existing config as necessary.
|
||||||
desanitize(oldCfg, newCfg)
|
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 {
|
if err := newCfg.IsValid(); err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "new configuration is invalid")
|
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")
|
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)
|
hasChanged, err := equal(oldCfg, newCfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "failed to compare configs")
|
return nil, nil, errors.Wrap(err, "failed to compare configs")
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user