Skip to content

Commit

Permalink
if no nics are set default to single dhcp (#1385)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Eyberg <ian@deferpanic.com>
  • Loading branch information
eyberg and Ian Eyberg committed Oct 6, 2022
1 parent d0e0aed commit bc48fd3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions proxmox/proxmox_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ func (p *ProxMox) CreateInstance(ctx *lepton.Context) error {

data.Set("net"+is, "model=virtio,bridge="+brName)
}
if len(nics) == 0 {
// single dhcp nic
data.Set("net0", "model=virtio,bridge=vmbr0")
}

req, err := http.NewRequest("POST", p.apiURL+"/api2/json/nodes/"+p.nodeNAME+"/qemu", bytes.NewBufferString(data.Encode()))
if err != nil {
Expand Down

0 comments on commit bc48fd3

Please sign in to comment.