mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-18 04:43:12 +02:00
Implement restart policy for VMs (#83)
* Implement restart policy for VMs * Do not update VM.Resource, we only use it as a read-only specification * Err()/setErr(): use atomic.Pointer instead of sync.Mutex
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"github.com/cirruslabs/orchard/pkg/client"
|
||||
v1 "github.com/cirruslabs/orchard/pkg/resource/v1"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
"time"
|
||||
)
|
||||
@@ -58,7 +57,7 @@ func runPauseWorker(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
hasActiveVMs := slices.ContainsFunc(maps.Values(vms), func(vm v1.VM) bool {
|
||||
hasActiveVMs := slices.ContainsFunc(vms, func(vm v1.VM) bool {
|
||||
return !vm.TerminalState()
|
||||
})
|
||||
if !hasActiveVMs {
|
||||
|
||||
Reference in New Issue
Block a user