Skip to content

Commit

Permalink
Make Type of VM Explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
jggoebel committed Sep 17, 2024
1 parent 86c0e6d commit 41b009e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion v3/pkg/apis/hobbyfarm.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type VirtualMachineList struct {
Items []VirtualMachine `json:"items"`
}

// Todo isSharedVM Enum?
type VirtualMachineSpec struct {
VirtualMachineTemplateId string `json:"vm_template_id"`
SshUsername string `json:"ssh_username"`
Expand Down
2 changes: 1 addition & 1 deletion v3/services/scheduledeventsvc/internal/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ func (sc *ScheduledEventController) taintSharedVMs(se *scheduledeventpb.Schedule
func (sc *ScheduledEventController) createSharedVMs(se *scheduledeventpb.ScheduledEvent) error {
for i := 0; i < len(se.GetSharedVms()); i++ {
sharedVM := se.GetSharedVms()[i]
// if sharedVM are provision (have VMId) continue, if new(empty VMId) create VM
// if sharedVM is provisioned (VMId is set) continue, if new sharedVM (empty VMId) we create the VM
if sharedVM.GetVmId() != "" {
continue
}
Expand Down
1 change: 1 addition & 0 deletions v3/services/vmclaimsvc/internal/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ func (v *VMClaimController) submitVirtualMachines(vmc *vmclaimpb.VMClaim) (err e
VmClaimUid: vmc.GetUid(),
User: vmc.GetUserId(),
Provision: true,
VmType: vmpb.VirtualMachineType_USER,
Labels: map[string]string{
"dynamic": "true",
"vmc": vmc.GetId(),
Expand Down
1 change: 1 addition & 0 deletions v3/services/vmsetsvc/internal/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func (v *VMSetController) reconcileVirtualMachineSet(vmset *vmsetpb.VMSet) error
Provision: provision,
VmSetId: vmset.GetId(),
VmSetUid: vmset.GetUid(),
VmType: vmpb.VirtualMachineType_USER,
Labels: vmLabels,
Finalizers: []string{vmSetFinalizer},
})
Expand Down

0 comments on commit 41b009e

Please sign in to comment.