@@ -33,7 +33,6 @@ import (
3333 vmutil "github.com/deckhouse/virtualization-controller/pkg/common/vm"
3434 "github.com/deckhouse/virtualization-controller/pkg/controller/conditions"
3535 "github.com/deckhouse/virtualization-controller/pkg/controller/kvbuilder"
36- "github.com/deckhouse/virtualization-controller/pkg/controller/powerstate"
3736 "github.com/deckhouse/virtualization-controller/pkg/controller/service"
3837 "github.com/deckhouse/virtualization-controller/pkg/controller/vm/internal/state"
3938 "github.com/deckhouse/virtualization-controller/pkg/controller/vmchange"
@@ -495,7 +494,7 @@ func (h *SyncKvvmHandler) canApplyChanges(
495494 if vm == nil || changes .IsEmpty () {
496495 return false
497496 }
498- if vmutil . ApprovalMode ( vm ) == virtv2 . Automatic || ! changes .IsDisruptive () || kvvmi == nil {
497+ if ! changes .IsDisruptive () || kvvmi == nil {
499498 return true
500499 }
501500
@@ -537,23 +536,10 @@ func (h *SyncKvvmHandler) applyVMChangesToKVVM(ctx context.Context, s state.Virt
537536
538537 switch action {
539538 case vmchange .ActionRestart :
540- h .recorder .WithLogging (log ).Event (current , corev1 .EventTypeNormal , virtv2 .ReasonVMChangesApplied , "Apply disruptive changes with restart" )
541- h .recorder .WithLogging (log ).Event (
542- current ,
543- corev1 .EventTypeNormal ,
544- virtv2 .ReasonVMRestarted ,
545- "Restart initiated by controller to apply changes" ,
546- )
547-
548539 // Update KVVM spec according the current VM spec.
549540 if err = h .updateKVVM (ctx , s ); err != nil {
550541 return fmt .Errorf ("update virtual machine instance with new spec: %w" , err )
551542 }
552- // Ask kubevirt to re-create KVVMI to apply new spec from KVVM.
553- err = powerstate .RestartVM (ctx , h .client , kvvm , kvvmi , false )
554- if err != nil {
555- return fmt .Errorf ("restart virtual machine instance to apply changes: %w" , err )
556- }
557543
558544 case vmchange .ActionApplyImmediate :
559545 message := "Apply changes without restart"
0 commit comments