Skip to content

Commit

Permalink
Make sure preflight check only runs when installation
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Wang <[email protected]>
(cherry picked from commit 79d112a)
  • Loading branch information
w13915984028 authored and starbops committed Nov 29, 2024
1 parent bfee788 commit 372953e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,17 @@ func (c *Console) doRun() error {
defer c.Close()

dashboard := c.layoutInstall
preflightCheck := true

if hd, _ := os.LookupEnv("HARVESTER_DASHBOARD"); hd == "true" {
if err := c.getHarvesterConfig(); err != nil {
return err
}
if c.config.Install.Mode == config.ModeCreate || c.config.Install.Mode == config.ModeJoin {
dashboard = c.layoutDashboard
// no need to do preflight check after the node is installed, it runs layoutDashboard directly
// preflightWarnings are used in layoutInstall
preflightCheck = false
}
}

Expand All @@ -151,9 +155,10 @@ func (c *Console) doRun() error {
logrus.Info("harvester already installed")
alreadyInstalled = true
c.config.Install.Mode = ""
preflightCheck = false
}

if !alreadyInstalled {
if preflightCheck {
checks := []preflight.Check{
preflight.CPUCheck{},
preflight.MemoryCheck{},
Expand Down

0 comments on commit 372953e

Please sign in to comment.