Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log validateConfig, PrepareWebooks and doInstall errors (backport #775) #776

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -2132,6 +2132,7 @@ func addInstallPanel(c *Console) error {
for _, warning := range preflightWarnings {
logrus.Warning(warning)
}
logrus.Info("Installation will proceed (harvester.install.skipchecks = true)")
} else {
// Checks were not explicitly skipped, fail the install
// (this will happen when PXE booted if checks fail and
Expand Down Expand Up @@ -2166,13 +2167,17 @@ func addInstallPanel(c *Console) error {
}

if err := validateConfig(ConfigValidator{}, c.config); err != nil {
printToPanel(c.Gui, err.Error(), installPanel)
msg := fmt.Sprintf("Invalid configuration: %s", err)
logrus.Error(msg)
printToPanel(c.Gui, msg, installPanel)
return
}

webhooks, err := PrepareWebhooks(c.config.Webhooks, getWebhookContext(c.config))
if err != nil {
printToPanel(c.Gui, fmt.Sprintf("invalid webhook: %s", err), installPanel)
msg := fmt.Sprintf("Invalid webhook: %s", err)
logrus.Error(msg)
printToPanel(c.Gui, msg, installPanel)
}

if alreadyInstalled {
Expand All @@ -2181,7 +2186,9 @@ func addInstallPanel(c *Console) error {
err = doInstall(c.Gui, c.config, webhooks)
}
if err != nil {
printToPanel(c.Gui, fmt.Sprintf("install failed: %s", err), installPanel)
msg := fmt.Sprintf("Install failed: %s", err)
logrus.Error(msg)
printToPanel(c.Gui, msg, installPanel)
}
}()
return c.setContentByName(footerPanel, "")
Expand Down
Loading