Skip to content

Commit

Permalink
Issue crc-org#1066 Remove call to logging.Fatal from machine.Start
Browse files Browse the repository at this point in the history
In case of the daemon, we don't want an error in machine.Start()
to exit the daemon process, logging.Fatal calls os.Exit which
kills the process
  • Loading branch information
anjannath committed Mar 5, 2020
1 parent 3ba6f26 commit 434949c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/crc/machine/machine.go
Expand Up @@ -185,8 +185,11 @@ func Start(startConfig StartConfig) (StartResult, error) {
return *result, errors.Newf("Error loading bundle metadata: %v", err)
}
if bundleName != filepath.Base(startConfig.BundlePath) {
logging.Fatalf("Bundle '%s' was requested, but the existing VM is using '%s'",
logging.Debugf("Bundle '%s' was requested, but the existing VM is using '%s'",
filepath.Base(startConfig.BundlePath), bundleName)
result.Error = fmt.Sprintf("Bundle '%s' was requested, but the existing VM is using '%s'",
filepath.Base(startConfig.BundlePath), bundleName)
return *result, errors.Newf("Found a CodeReady Containers VM using bundle %s", filepath.Base(startConfig.BundlePath)
}
vmState, err := host.Driver.GetState()
if err != nil {
Expand Down

0 comments on commit 434949c

Please sign in to comment.