mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-16 07:05:14 +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>
(cherry picked from commit 18d42da21e
)
Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
f86bfe0da3
commit
9ce8ee6c0c
@ -722,19 +722,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