Skip to content

Commit 509b824

Browse files
authored
net: use routes.running instead of routes.config in nns lookup (RedHatQE#2385)
Previously, the code accessed `routes.config` to retrieve route information from the NodeNetworkState resource. However, `routes.config` represents the desired configuration, not the actual state of the node's network routes. To ensure that the lookup reflects the real, currently active routes on the node, the code now uses `routes.running`. This change improves accuracy by querying the live state, which is essential for operations that depend on the actual network setup. Signed-off-by: Sergei Volkov <sevolkov@redhat.com>
1 parent 6ee6fa2 commit 509b824

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/network/libs/nodenetworkstate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def lookup_br_ex_gateway_v4(node_name: str, client: DynamicClient) -> str:
2828
"""
2929
nns_state = NodeNetworkState(name=node_name, client=client, ensure_exists=True).instance.status.currentState
3030

31-
for route in nns_state.routes.config:
31+
for route in nns_state.routes.running:
3232
if route.destination == DEFAULT_ROUTE_V4.dst and route["next-hop-interface"] == DEFAULT_OVN_EXTERNAL_BRIDGE:
3333
return route["next-hop-address"]
3434

0 commit comments

Comments
 (0)