0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 10:33:46 +00:00

fix(vm): regression: vga.clipboard attribute check (#1340)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2024-05-29 21:36:47 -04:00 committed by GitHub
parent b60ea9900f
commit 2785c40d44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 1 deletions

View File

@ -107,6 +107,10 @@ resource "proxmox_virtual_environment_vm" "example_template" {
serial_device {}
vga {
type = "qxl"
}
template = true
// use auto-generated vm_id

View File

@ -175,7 +175,8 @@ func TestAccResourceVM(t *testing.T) {
}`),
Check: resource.ComposeTestCheckFunc(
ResourceAttributes("proxmox_virtual_environment_vm.test_vm", map[string]string{
"vga.0.type": "none",
"vga.0.type": "none",
"vga.0.clipboard": "",
}),
),
}, {
@ -195,6 +196,23 @@ func TestAccResourceVM(t *testing.T) {
"vga.0.clipboard": "vnc",
}),
),
}, {
Config: te.RenderConfig(`
resource "proxmox_virtual_environment_vm" "test_vm" {
node_name = "{{.NodeName}}"
started = false
vga {
type = "virtio-gl"
clipboard = ""
}
}`),
Check: resource.ComposeTestCheckFunc(
ResourceAttributes("proxmox_virtual_environment_vm.test_vm", map[string]string{
"vga.0.type": "virtio-gl",
"vga.0.clipboard": "",
}),
),
}},
},
}

View File

@ -66,6 +66,9 @@ func TestAccResourceVM2VGA(t *testing.T) {
"vga.type": "std",
"vga.memory": "16",
}),
test.NoResourceAttributesSet("proxmox_virtual_environment_vm2.test_vm", []string{
"vga.clipboard",
}),
),
},
{ // now update the vga params and check if they are updated

View File

@ -1403,6 +1403,7 @@ func VM() *schema.Resource {
Optional: true,
Default: dvVGAClipboard,
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{
"",
"vnc",
}, true)),
},