mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 18:47:03 +00:00
katautils: check config template and vsock
Vsock conflicts with factory, when both of them are enabled, kata will try to create a new vm template which is useless, thus it's better to return an error directly to let users know that those two config cannot be enabled at the same time. Fixes: #1055 Signed-off-by: fupan <lifupan@gmail.com>
This commit is contained in:
parent
bcf995bfe1
commit
e4e7c3ae54
@ -737,8 +737,14 @@ func checkNetNsConfig(config oci.RuntimeConfig) error {
|
||||
|
||||
// checkFactoryConfig ensures the VM factory configuration is valid.
|
||||
func checkFactoryConfig(config oci.RuntimeConfig) error {
|
||||
if config.FactoryConfig.Template && config.HypervisorConfig.InitrdPath == "" {
|
||||
return errors.New("Factory option enable_template requires an initrd image")
|
||||
if config.FactoryConfig.Template {
|
||||
if config.HypervisorConfig.InitrdPath == "" {
|
||||
return errors.New("Factory option enable_template requires an initrd image")
|
||||
}
|
||||
|
||||
if config.HypervisorConfig.UseVSock {
|
||||
return errors.New("config vsock conflicts with factory, please disable one of them")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user