Skip to content

Commit

Permalink
fix: DHCP fails with a VLAN ID
Browse files Browse the repository at this point in the history
Signed-off-by: Kiefer Chang <[email protected]>
  • Loading branch information
bk201 committed Nov 6, 2024
1 parent b85cf7c commit 59dfe82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ func addNetworkPanel(c *Console) error {
c.config.ManagementInterface = mgmtNetwork

if mgmtNetwork.Method == config.NetworkMethodDHCP {
addr, err := getIPThroughDHCP(config.MgmtInterfaceName)
addr, err := getIPThroughDHCP(getManagementInterfaceName(mgmtNetwork))
if err != nil {
return fmt.Sprintf("Requesting IP through DHCP failed: %s", err.Error()), nil
}
Expand Down Expand Up @@ -2602,14 +2602,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(mgmtNetwork))
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(mgmtNetwork))
if err != nil {
printToPanel(c.Gui, fmt.Sprintf("fail to get vip: %s", err), installPanel)
return
Expand Down
1 change: 1 addition & 0 deletions pkg/console/vip.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func getVipThroughDHCP(iface string) (*vipAddr, error) {
}

func getIPThroughDHCP(iface string) (net.IP, error) {
logrus.Infof("Get IP through DHCP via interface %s", iface)
broadcast, err := nclient4.New(iface)
if err != nil {
return nil, err
Expand Down

0 comments on commit 59dfe82

Please sign in to comment.