mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-15 22:08:47 +00:00
Merge pull request #505 from bergwolf/create_factory
cli: create vm factory if failed to load existing one
This commit is contained in:
@@ -120,8 +120,13 @@ func create(containerID, bundlePath, console, pidFilePath string, detach bool,
|
||||
kataLog.WithField("factory", factoryConfig).Info("load vm factory")
|
||||
f, err := vf.NewFactory(factoryConfig, true)
|
||||
if err != nil {
|
||||
kataLog.WithError(err).Info("load vm factory failed")
|
||||
} else {
|
||||
kataLog.WithError(err).Warn("load vm factory failed, about to create new one")
|
||||
f, err = vf.NewFactory(factoryConfig, false)
|
||||
if err != nil {
|
||||
kataLog.WithError(err).Warn("create vm factory failed")
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
vci.SetFactory(f)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user