Add validation to require serial device when vga type is set to serial - #1443
Open
kmonticolo wants to merge 3 commits into
Open
Add validation to require serial device when vga type is set to serial#1443kmonticolo wants to merge 3 commits into
kmonticolo wants to merge 3 commits into
Conversation
Author
|
fixes #1440 |
Tinyblargon
self-requested a review
November 2, 2025 20:08
Tinyblargon
reviewed
Nov 28, 2025
|
|
||
| func validateVGAAndSerial(d *schema.ResourceData) error { | ||
| // Get VGA configuration | ||
| vgaList := d.Get("vga").([]interface{}) |
Collaborator
There was a problem hiding this comment.
This panics when "vga" is not defined.
Author
There was a problem hiding this comment.
thanks, fixed:
terraform plan
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: when vga.type is set to 'serial', at least one serial device must be configured in the 'serial' block
│
│ with proxmox_vm_qemu.test,
│ on main.tf line 36, in resource "proxmox_vm_qemu" "test":
│ 36: resource "proxmox_vm_qemu" "test" {
Tinyblargon
reviewed
Nov 28, 2025
| } | ||
| } | ||
|
|
||
| func validateVGAAndSerial(d *schema.ResourceData) error { |
Collaborator
There was a problem hiding this comment.
My advise would be to implement the logic by parsing the config defined by:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add validation to ensure serial device is defined when vga type is serial.