mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 18:23:12 +00:00
cli: create vm factory if failed to load existing one
When vm factory is enabled, create vm factory automatically during creation. Fixes: #504 Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
parent
14d25b82a4
commit
4656a72b92
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user