mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
runtime/fc: fix image/initrd annotation handling
Right now if we configure an image annotation and have a config file setting initrd, the initrd config would override the image annotation. Make sure annotations are preferred over config options in image and initrd path handling. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
9fda7059a5
commit
18d42da21e
@ -721,19 +721,12 @@ func (fc *firecracker) fcInitConfiguration(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
image, err := fc.config.InitrdAssetPath()
|
||||
assetPath, _, err := fc.config.ImageOrInitrdAssetPath()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if image == "" {
|
||||
image, err = fc.config.ImageAssetPath()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := fc.fcSetVMRootfs(ctx, image); err != nil {
|
||||
if err := fc.fcSetVMRootfs(ctx, assetPath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user