Skip to content

Commit

Permalink
Set VipMode value in static mode (#930)
Browse files Browse the repository at this point in the history
* Set VipMode value in static mode

Signed-off-by: Jian Wang <[email protected]>

* Use precise message for VipMode

Signed-off-by: Jian Wang <[email protected]>

---------

Signed-off-by: Jian Wang <[email protected]>
  • Loading branch information
w13915984028 authored Jan 21, 2025
1 parent 6982d88 commit 9ae474d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -2581,6 +2581,10 @@ func addVIPPanel(c *Console) error {

c.config.Vip = vip
c.config.VipHwAddr = ""
// gotoVipPanel is only called in DHCP mode, it is still empty in static mode
if c.config.VipMode == "" {
c.config.VipMode = config.NetworkMethodStatic
}
return gotoNextPage(g, v)
}
gotoAskVipMethodPanel := func(_ *gocui.Gui, _ *gocui.View) error {
Expand Down
3 changes: 2 additions & 1 deletion pkg/console/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var (
ErrMsgForceMBROnUEFI = "cannot force MBR on UEFI system"

ErrMsgNetworkMethodUnknown = "unknown network method"
ErrMsgVipModeUnknown = "unknown vip mode"

ErrMsgSystemSettingsUnknown = "unknown system settings: %s"

Expand Down Expand Up @@ -271,7 +272,7 @@ func checkVip(vip, vipHwAddr, vipMode string) error {
case config.NetworkMethodStatic, config.NetworkMethodNone:
return nil
default:
return prettyError(ErrMsgNetworkMethodUnknown, vipMode)
return prettyError(ErrMsgVipModeUnknown, vipMode)
}

return nil
Expand Down

0 comments on commit 9ae474d

Please sign in to comment.