From bc79740ff25fd9a2668fbc78493363348c3b899a Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Fri, 8 Mar 2024 15:35:37 +0800 Subject: [PATCH] fix: enable secure boot Signed-off-by: PoAn Yang --- harvester/create.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/harvester/create.go b/harvester/create.go index 91bb9288..e6f1beba 100644 --- a/harvester/create.go +++ b/harvester/create.go @@ -99,7 +99,11 @@ func (d *Driver) Create() error { vm.APIVersion = kubevirtv1.GroupVersion.String() if d.EnableEFI { + if vm.Spec.Template.Spec.Domain.Features == nil { + vm.Spec.Template.Spec.Domain.Features = &kubevirtv1.Features{} + } v := d.EnableSecureBoot + vm.Spec.Template.Spec.Domain.Features.SMM = &kubevirtv1.FeatureState{Enabled: &v} vm.Spec.Template.Spec.Domain.Firmware = &kubevirtv1.Firmware{Bootloader: &kubevirtv1.Bootloader{EFI: &kubevirtv1.EFI{SecureBoot: &v}}} } createdVM, err := d.createVM(vm)