Skip to content

Commit

Permalink
hypervisor: don't init in install mode
Browse files Browse the repository at this point in the history
if containerd is initialized during installation the installation will
fail generating an onboarding certificate

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
  • Loading branch information
christoph-zededa authored and eriknordmark committed Nov 1, 2023
1 parent f001135 commit 8b66837
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/mkimage-raw-efi/install
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ BAIL_FINAL_CMD=${BAIL_FINAL_CMD:-"exit 1"}
# the contents of this file are saved to $REPORT/installer.log
# After the USB install, users can see the installation status under /Volumes/INVENTORY/<serial#>/installer.log
LOGFILE_DIR="/run"

# pillar behaves differently if this file exists to check if it is running in installer mode - see hypervisor.go
LOGFILE="$LOGFILE_DIR/installer.log"
# logs to both console and a file.
logmsg() {
Expand Down
7 changes: 7 additions & 0 deletions pkg/pillar/hypervisor/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"

"github.com/lf-edge/eve/pkg/pillar/types"
fileutils "github.com/lf-edge/eve/pkg/pillar/utils/file"
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/mem"
"github.com/sirupsen/logrus"
Expand All @@ -18,6 +19,12 @@ import (
var currentHypervisor Hypervisor

func init() {
if fileutils.FileExists(nil, "/run/installer.log") {
// if this file exists it means we're running in the installer and we should not inititialize the containerd
// hypervisor as it interferes with the installer
return
}

var err error

flagSet := flag.NewFlagSet("", flag.ExitOnError)
Expand Down

0 comments on commit 8b66837

Please sign in to comment.