Skip to content

Commit

Permalink
feat(core/virtual-machine): add new "allocating" and "allocated" states
Browse files Browse the repository at this point in the history
This add constants for two new possible VM states which each VM briefly
transitions through during start up.
  • Loading branch information
jimehk committed Mar 7, 2024
1 parent 97ab38c commit 64e75f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type VirtualMachineState string
const (
VirtualMachineStopped VirtualMachineState = "stopped"
VirtualMachineFailed VirtualMachineState = "failed"
VirtualMachineAllocating VirtualMachineState = "allocating"
VirtualMachineAllocated VirtualMachineState = "allocated"
VirtualMachineStarted VirtualMachineState = "started"
VirtualMachineStarting VirtualMachineState = "starting"
VirtualMachineResetting VirtualMachineState = "resetting"
Expand Down
10 changes: 10 additions & 0 deletions core/virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ func TestVirtualMachineStates(t *testing.T) {
enum: VirtualMachineFailed,
value: "failed",
},
{
name: "VirtualMachineAllocating",
enum: VirtualMachineAllocating,
value: "allocating",
},
{
name: "VirtualMachineAllocated",
enum: VirtualMachineAllocated,
value: "allocated",
},
{
name: "VirtualMachineStarted",
enum: VirtualMachineStarted,
Expand Down

0 comments on commit 64e75f2

Please sign in to comment.