Skip to content

Commit

Permalink
Fix off vm should not be able to stop again
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo authored and guangbochen committed Jul 13, 2021
1 parent a039b40 commit 6ae8d8e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/api/vm/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package vm
import (
"github.com/rancher/apiserver/pkg/types"
"github.com/rancher/wrangler/pkg/data/convert"
"k8s.io/utils/pointer"
kv1 "kubevirt.io/client-go/api/v1"

"github.com/harvester/harvester/pkg/controller/master/migration"
Expand Down Expand Up @@ -151,7 +150,7 @@ func (vf *vmformatter) canRestart(vm *kv1.VirtualMachine, vmi *kv1.VirtualMachin
}

func (vf *vmformatter) canStop(vm *kv1.VirtualMachine) bool {
if vm.Spec.Running != nil && vm.Spec.Running == pointer.BoolPtr(false) {
if vm.Spec.Running != nil && !*vm.Spec.Running {
return false
}

Expand Down

0 comments on commit 6ae8d8e

Please sign in to comment.