Merge pull request #12696 from thalesmg/fix-default-enable-r56-20240313

fix(bridges): fix default value for `enable` when attempting operations
This commit is contained in:
Thales Macedo Garitezi 2024-03-14 09:50:40 -03:00 committed by GitHub
commit e340ab7f1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 3 deletions

View File

@ -764,7 +764,7 @@ is_bridge_enabled_v1(BridgeType, BridgeName) ->
%% we read from the translated config because the defaults are populated here.
try emqx:get_config([bridges, BridgeType, binary_to_existing_atom(BridgeName)]) of
ConfMap ->
maps:get(enable, ConfMap, false)
maps:get(enable, ConfMap, true)
catch
error:{config_not_found, _} ->
throw(not_found);

View File

@ -990,7 +990,7 @@ call_operation_if_enabled(NodeOrAll, OperFunc, [Nodes, ConfRootKey, BridgeType,
is_enabled_bridge(ConfRootKey, BridgeType, BridgeName) ->
try emqx_bridge_v2:lookup(ConfRootKey, BridgeType, binary_to_existing_atom(BridgeName)) of
{ok, #{raw_config := ConfMap}} ->
maps:get(<<"enable">>, ConfMap, false);
maps:get(<<"enable">>, ConfMap, true);
{error, not_found} ->
throw(not_found)
catch

View File

@ -532,7 +532,7 @@ call_operation_if_enabled(NodeOrAll, OperFunc, [Nodes, BridgeType, BridgeName])
is_enabled_connector(ConnectorType, ConnectorName) ->
try emqx:get_config([connectors, ConnectorType, binary_to_existing_atom(ConnectorName)]) of
ConfMap ->
maps:get(enable, ConfMap, false)
maps:get(enable, ConfMap, true)
catch
error:{config_not_found, _} ->
throw(not_found);

View File

@ -0,0 +1 @@
Fixed an issue where attempting to reconnect an action or source could lead to the wrong error message being returned in the HTTP API.