diff --git a/internal/agent/hooks/runstage.go b/internal/agent/hooks/runstage.go index d47c7e9..c7b8206 100644 --- a/internal/agent/hooks/runstage.go +++ b/internal/agent/hooks/runstage.go @@ -9,7 +9,7 @@ import ( type RunStage struct{} -func (r RunStage) Run(c config.Config) error { +func (r RunStage) Run(_ config.Config) error { utils.SH("elemental run-stage kairos-install.after") //nolint:errcheck events.RunHookScript("/usr/bin/kairos-agent.install.after.hook") //nolint:errcheck return nil diff --git a/internal/agent/iconunix.go b/internal/agent/iconunix.go index e3eb223..c6bb976 100644 --- a/internal/agent/iconunix.go +++ b/internal/agent/iconunix.go @@ -5,7 +5,7 @@ package agent -var DefaultBanner []byte = []byte{ +var DefaultBanner = []byte{ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x70, 0x00, 0x00, 0x01, 0xae, 0x08, 0x06, 0x00, 0x00, 0x00, 0x89, 0x2d, 0x5d, 0x60, 0x00, 0x00, 0x00, diff --git a/internal/agent/install.go b/internal/agent/install.go index 4626b8c..9f03c5c 100644 --- a/internal/agent/install.go +++ b/internal/agent/install.go @@ -312,11 +312,7 @@ func RunInstall(options map[string]string) error { os.Exit(1) } - if err := hook.Run(*c, hook.AfterInstall...); err != nil { - return err - } - - return nil + return hook.Run(*c, hook.AfterInstall...) } func ensureDataSourceReady() { diff --git a/internal/bus/bus.go b/internal/bus/bus.go index b90dbc4..8e1f75c 100644 --- a/internal/bus/bus.go +++ b/internal/bus/bus.go @@ -62,10 +62,10 @@ func (b *Bus) Initialize() { err := fmt.Sprintf("Provider %s at %s had an error: %s", p.Name, p.Executable, r.Error) fmt.Println(err) os.Exit(1) - } else { - if r.State != "" { - fmt.Println(fmt.Sprintf("[provider event: %s]", e), r.State) - } + } + + if r.State != "" { + fmt.Println(fmt.Sprintf("[provider event: %s]", e), r.State) } }) } diff --git a/internal/webui/webui.go b/internal/webui/webui.go index cedf566..136ce2b 100644 --- a/internal/webui/webui.go +++ b/internal/webui/webui.go @@ -5,7 +5,6 @@ import ( "embed" "io" "io/fs" - "io/ioutil" "log" "net/http" "os" @@ -210,7 +209,7 @@ func Start(ctx context.Context) error { args = append(args, "--device", installationDevice) // create tempfile to store cloud-config, bail out if we fail as we couldn't go much further - file, err := ioutil.TempFile("", "install-webui") + file, err := os.CreateTemp("", "install-webui") if err != nil { log.Fatalf("could not create tmpfile for cloud-config: %s", err.Error()) }