Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Fix Pool setting results in error 400 #307

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions proxmox/config_guest.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ func (GuestResource) mapToStruct(params []interface{}) []GuestResource {
if _, isSet := tmpParams["node"]; isSet {
resources[i].Node = tmpParams["node"].(string)
}
if _, isSet := tmpParams["pool"]; isSet {
resources[i].Pool = tmpParams["pool"].(string)
}
if _, isSet := tmpParams["status"]; isSet {
resources[i].Status = tmpParams["status"].(string)
}
Expand Down
10 changes: 0 additions & 10 deletions proxmox/config_guest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ func Test_GuestResource_mapToStruct(t *testing.T) {
input: []interface{}{map[string]interface{}{"node": "pve1"}},
output: []GuestResource{{Node: "pve1"}},
},
{name: "Pool",
input: []interface{}{map[string]interface{}{"pool": "Production"}},
output: []GuestResource{{Pool: "Production"}},
},
{name: "Status",
input: []interface{}{map[string]interface{}{"status": "running"}},
output: []GuestResource{{Status: "running"}},
Expand Down Expand Up @@ -109,7 +105,6 @@ func Test_GuestResource_mapToStruct(t *testing.T) {
"netin": float64(23884639),
"netout": float64(1000123465987),
"node": "pve1",
"pool": "Production",
"status": "running",
"tags": "tag1;tag2;tag3",
"template": float64(0),
Expand All @@ -131,7 +126,6 @@ func Test_GuestResource_mapToStruct(t *testing.T) {
"netin": float64(2331323424),
"netout": float64(88775378423476),
"node": "pve2",
"pool": "Development",
"status": "running",
"tags": "dev",
"template": float64(0),
Expand All @@ -153,7 +147,6 @@ func Test_GuestResource_mapToStruct(t *testing.T) {
"netin": float64(23884639),
"netout": float64(1000123465987),
"node": "node3",
"pool": "Templates",
"status": "stopped",
"tags": "template",
"template": float64(1),
Expand All @@ -177,7 +170,6 @@ func Test_GuestResource_mapToStruct(t *testing.T) {
NetworkIn: 23884639,
NetworkOut: 1000123465987,
Node: "pve1",
Pool: "Production",
Status: "running",
Tags: []string{"tag1", "tag2", "tag3"},
Template: false,
Expand All @@ -199,7 +191,6 @@ func Test_GuestResource_mapToStruct(t *testing.T) {
NetworkIn: 2331323424,
NetworkOut: 88775378423476,
Node: "pve2",
Pool: "Development",
Status: "running",
Tags: []string{"dev"},
Template: false,
Expand All @@ -221,7 +212,6 @@ func Test_GuestResource_mapToStruct(t *testing.T) {
NetworkIn: 23884639,
NetworkOut: 1000123465987,
Node: "node3",
Pool: "Templates",
Status: "stopped",
Tags: []string{"template"},
Template: true,
Expand Down
4 changes: 0 additions & 4 deletions proxmox/config_lxc.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,6 @@ func (config ConfigLxc) CloneLxc(vmr *VmRef, client *Client) (err error) {
paramMap["hostname"] = config.Hostname
}

if config.Pool != "" {
paramMap["pool"] = config.Pool
}

if config.Snapname != "" {
paramMap["snapname"] = config.Snapname
}
Expand Down
7 changes: 0 additions & 7 deletions proxmox/config_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ func (config ConfigQemu) CreateVm(vmr *VmRef, client *Client) (err error) {
if config.QemuVcpus >= 1 {
params["vcpus"] = config.QemuVcpus
}

if vmr.pool != "" {
params["pool"] = vmr.pool
}
if config.Boot != "" {
params["boot"] = config.Boot
}
Expand Down Expand Up @@ -366,9 +362,6 @@ func (config ConfigQemu) mapToApiValues(currentConfig ConfigQemu) (rebootRequire
if config.QemuOs != "" {
params["ostype"] = config.QemuOs
}
if config.Pool != "" {
params["pool"] = config.Pool
}
if config.Scsihw != "" {
params["scsihw"] = config.Scsihw
}
Expand Down
Loading