mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-29 19:41:15 +02:00
Allow creating VMs with implicit CPU and memory (#243)
* Allow creating VMs with implicit CPU and memory * Clarify why cpu/memory can be 0 a bit better * Controller(API): don't forget to update DefaultCPU and DefaultMemory * Add an integration test for implicit CPU and memory
This commit is contained in:
@@ -34,12 +34,6 @@ func (controller *Controller) createVM(ctx *gin.Context) responder.Responder {
|
||||
if vm.Image == "" {
|
||||
return responder.JSON(http.StatusPreconditionFailed, NewErrorResponse("VM image is empty"))
|
||||
}
|
||||
if vm.CPU == 0 {
|
||||
return responder.JSON(http.StatusPreconditionFailed, NewErrorResponse("VM CPU is zero"))
|
||||
}
|
||||
if vm.Memory == 0 {
|
||||
return responder.JSON(http.StatusPreconditionFailed, NewErrorResponse("VM memory is zero"))
|
||||
}
|
||||
|
||||
vm.Status = v1.VMStatusPending
|
||||
vm.CreatedAt = time.Now()
|
||||
|
||||
Reference in New Issue
Block a user