From 86d409675c79beefbf9a7f7fc4df9f79719c7804 Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Wed, 6 Nov 2024 12:28:46 +0100 Subject: [PATCH] Sure DHCP will work on VLAN interface if VLAN is configured Signed-off-by: Jian Wang (cherry picked from commit aae8b1d3642cf75ca8fcfa56bfec209eb7a4b54c) --- pkg/console/install_panels.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/console/install_panels.go b/pkg/console/install_panels.go index ddc5efb28..39a4952e3 100644 --- a/pkg/console/install_panels.go +++ b/pkg/console/install_panels.go @@ -1378,7 +1378,7 @@ func addNetworkPanel(c *Console) error { c.config.ManagementInterface = mgmtNetwork if mgmtNetwork.Method == config.NetworkMethodDHCP { - addr, err := getIPThroughDHCP(config.MgmtInterfaceName) + addr, err := getIPThroughDHCP(getManagementInterfaceName(c.config.ManagementInterface)) if err != nil { return fmt.Sprintf("Requesting IP through DHCP failed: %s", err.Error()), nil } @@ -2571,14 +2571,14 @@ func configureInstallModeDHCP(c *Console) { printToPanel(c.Gui, fmt.Sprintf("error applying network configuration: %s", err.Error()), installPanel) } - _, err = getIPThroughDHCP(config.MgmtInterfaceName) + _, err = getIPThroughDHCP(getManagementInterfaceName(c.config.ManagementInterface)) if err != nil { printToPanel(c.Gui, fmt.Sprintf("error getting DHCP address: %s", err.Error()), installPanel) } // if need vip via dhcp if c.config.Install.VipMode == config.NetworkMethodDHCP { - vip, err := getVipThroughDHCP(config.MgmtInterfaceName) + vip, err := getVipThroughDHCP(getManagementInterfaceName(c.config.ManagementInterface)) if err != nil { printToPanel(c.Gui, fmt.Sprintf("fail to get vip: %s", err), installPanel) return