Merge pull request #10190 from keynslug/fix/EMQX-9269/bridge-list
fix(bridge-api): unflatten nodes' bridge lists back
This commit is contained in:
commit
bf35419b52
|
@ -71,8 +71,8 @@
|
||||||
|
|
||||||
-define(BRIDGE_NOT_FOUND(BRIDGE_TYPE, BRIDGE_NAME),
|
-define(BRIDGE_NOT_FOUND(BRIDGE_TYPE, BRIDGE_NAME),
|
||||||
?NOT_FOUND(
|
?NOT_FOUND(
|
||||||
<<"Bridge lookup failed: bridge named '", BRIDGE_NAME/binary, "' of type ",
|
<<"Bridge lookup failed: bridge named '", (BRIDGE_NAME)/binary, "' of type ",
|
||||||
(atom_to_binary(BRIDGE_TYPE))/binary, " does not exist.">>
|
(bin(BRIDGE_TYPE))/binary, " does not exist.">>
|
||||||
)
|
)
|
||||||
).
|
).
|
||||||
|
|
||||||
|
@ -507,10 +507,10 @@ schema("/bridges_probe") ->
|
||||||
case is_ok(NodeReplies) of
|
case is_ok(NodeReplies) of
|
||||||
{ok, NodeBridges} ->
|
{ok, NodeBridges} ->
|
||||||
AllBridges = [
|
AllBridges = [
|
||||||
format_resource(Data, Node)
|
[format_resource(Data, Node) || Data <- Bridges]
|
||||||
|| {Node, Bridges} <- lists:zip(Nodes, NodeBridges), Data <- Bridges
|
|| {Node, Bridges} <- lists:zip(Nodes, NodeBridges)
|
||||||
],
|
],
|
||||||
?OK(zip_bridges([AllBridges]));
|
?OK(zip_bridges(AllBridges));
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?INTERNAL_ERROR(Reason)
|
?INTERNAL_ERROR(Reason)
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fix the issue where nodes responses to the list bridges RPC were incorrectly flattened, which caused List Bridges API HTTP handler to crash when there was more than 1 node in the cluster.
|
Loading…
Reference in New Issue