From 8796199790ddf1d37d8e86df857f286b582db81b Mon Sep 17 00:00:00 2001 From: Michal Opala Date: Tue, 2 Jan 2024 14:29:16 +0100 Subject: [PATCH] F OpenNebula/one#6280: Add backend detection for VRouter's LBs (#2860) --- src/onegate/onegate-server.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/onegate/onegate-server.rb b/src/onegate/onegate-server.rb index ada4329022..7b0607768a 100644 --- a/src/onegate/onegate-server.rb +++ b/src/onegate/onegate-server.rb @@ -855,6 +855,18 @@ def build_vnet_hash(vnet, client, extended) # Get extended info lease['NIC_NAME'] = nic['NAME'] + + xpath = "./TEMPLATE/CONTEXT/BACKEND" + backend = vm.retrieve_xmlelements(xpath)[0] + + if !backend.nil? && backend.text.downcase == 'yes' + lease['BACKEND'] = 'YES' + + xpath = "./USER_TEMPLATE/*[starts-with(local-name(), 'ONEGATE_')]" + vm.retrieve_xmlelements(xpath).each do |item| + lease[item.name] = item.text + end + end end end