Skip to content

Commit

Permalink
ovirt: do not set empty features and clock
Browse files Browse the repository at this point in the history
The features and clock settings are taken from the corresponding
template in kubevirt, if exists, we do not want to override them with
empty settings.

Signed-off-by: Arik Hadas <[email protected]>
  • Loading branch information
ahadas committed Nov 8, 2023
1 parent fe1ebc2 commit 38418a3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/controller/plan/adapter/ovirt/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,14 @@ func (r *Builder) mapInput(object *cnv.VirtualMachineSpec) {
}

func (r *Builder) mapClock(vm *model.Workload, object *cnv.VirtualMachineSpec) {
clock := cnv.Clock{
Timer: &cnv.Timer{},
if object.Template.Spec.Domain.Clock == nil {
object.Template.Spec.Domain.Clock = &cnv.Clock{
Timer: &cnv.Timer{},
}
}

timezone := cnv.ClockOffsetTimezone(vm.Timezone)
clock.Timezone = &timezone
object.Template.Spec.Domain.Clock = &clock
object.Template.Spec.Domain.Clock.Timezone = &timezone
}

func (r *Builder) mapMemory(vm *model.Workload, object *cnv.VirtualMachineSpec) {
Expand Down Expand Up @@ -397,7 +399,6 @@ func (r *Builder) mapFirmware(vm *model.Workload, cluster *model.Cluster, object
if serial == "" {
serial = vm.ID
}
features := &cnv.Features{}
firmware := &cnv.Firmware{
Serial: serial,
UUID: types.UID(vm.ID),
Expand All @@ -415,7 +416,6 @@ func (r *Builder) mapFirmware(vm *model.Workload, cluster *model.Cluster, object
default:
firmware.Bootloader = &cnv.Bootloader{BIOS: &cnv.BIOS{}}
}
object.Template.Spec.Domain.Features = features
object.Template.Spec.Domain.Firmware = firmware
}

Expand Down

0 comments on commit 38418a3

Please sign in to comment.