mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 15:02:45 +00:00
config: Add hypervisor path override through annotations
The annotation is provided, so it should be respected. Furthermore, it is important to implement it with the appropriate protetions similar to what was done for virtiofsd. Fixes: #901 Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
This commit is contained in:
parent
2e093dfd8b
commit
2ca9ca892d
@ -393,6 +393,13 @@ func addHypervisorConfigOverrides(ocispec specs.Spec, config *vc.SandboxConfig,
|
||||
return err
|
||||
}
|
||||
|
||||
if value, ok := ocispec.Annotations[vcAnnotations.HypervisorPath]; ok {
|
||||
if !regexpContains(runtime.HypervisorConfig.HypervisorPathList, value) {
|
||||
return fmt.Errorf("hypervisor %v required from annotation is not valid", value)
|
||||
}
|
||||
config.HypervisorConfig.HypervisorPath = value
|
||||
}
|
||||
|
||||
if value, ok := ocispec.Annotations[vcAnnotations.KernelParams]; ok {
|
||||
if value != "" {
|
||||
params := vc.DeserializeParams(strings.Fields(value))
|
||||
|
Loading…
Reference in New Issue
Block a user