fix: reflect bridge V1 upgrade in override configurations

Fixes:
https://emqx.atlassian.net/browse/EMQX-11353
This commit is contained in:
Kjell Winblad 2023-11-10 12:41:04 +01:00
parent 42fa1289a1
commit 6ebf0d1bdd
1 changed files with 4 additions and 2 deletions

View File

@ -662,14 +662,16 @@ remove_from_override_config(_BinKeyPath, #{persistent := false}) ->
undefined;
remove_from_override_config(BinKeyPath, Opts) ->
OldConf = emqx_config:read_override_conf(Opts),
emqx_utils_maps:deep_remove(BinKeyPath, OldConf).
UpgradedOldConf = emqx_conf_schema:upgrade_raw_conf(OldConf),
emqx_utils_maps:deep_remove(BinKeyPath, UpgradedOldConf).
%% apply new config on top of override config
merge_to_override_config(_RawConf, #{persistent := false}) ->
undefined;
merge_to_override_config(RawConf, Opts) ->
OldConf = emqx_config:read_override_conf(Opts),
maps:merge(OldConf, RawConf).
UpgradedOldConf = emqx_conf_schema:upgrade_raw_conf(OldConf),
maps:merge(UpgradedOldConf, RawConf).
up_req({remove, _Opts}) -> '$remove';
up_req({{update, Req}, _Opts}) -> Req.