-
Notifications
You must be signed in to change notification settings - Fork 242
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 empty cloud init ipconfig #238
Conversation
14988ee
to
9776008
Compare
Hi @tnyeanderson, I changed the Ipconfig handling in this PR: #216 I can't reproduce your issue here. Running {
"name": "golang1.test.com",
"desc": "Test proxmox-api-go",
"memory": 2048,
"os": "l26",
"cores": 2,
"sockets": 1,
"network": {
"0": {
"model": "virtio",
"bridge": "vmbr0"
}
}
} Please test if your issue occurs when you use |
Thank you for taking a look, Sebastian :) I have a feeling it was introduced in Telmate/terraform-provider-proxmox#653 I still think this PR might be valid based on the diff from #216 (the checks for empty strings were replaced with a nil check) so I'm not closing it yet. But I will put it in draft while I figure out what happened on the provider side. Running into the "things aren't strongly typed" hurdle again here, so I'll need to take some time to understand what is going on in the code. Speaking of which, is there a reason |
I can remember that I tried using |
Found the provider fix in Telmate/terraform-provider-proxmox#696, but I do think this PR is still relevant. Currently, the If an empty string ipconfig value should not be applied (as it wasn't being applied before), then we should check for that condition and account for it, which this PR does |
Hey @tnyeanderson thanks for taking a look at the Terraform provider. Since your change seems harmless - ack from my side. |
Hello, I reproduce this issue.
The main.tf part: resource "proxmox_vm_qemu" "pxe-minimal-example" {
name = "pxe-minimal-example"
agent = 0
boot = "order=net0;scsi0"
pxe = true
target_node = var.target_node
network {
bridge = "vmbr0"
firewall = false
link_down = false
model = "e1000"
}
}
Version:
|
Fix empty cloud init ipconfig
For the life of me I cannot figure out what is happening... but empty (non-existent)
config.Ipconfig
entries are being unmarshaled as empty strings instead ofnil
which causes the insurmountable error below:Below is the
docker-test
terraform config:I have tried bisecting the issue and cannot pin down where it was introduced or why it is happening. But the included fix makes it work for me.
P.S. I was able to determine that, in my case, none of the Ipconfig entries were unmarshaled as anything except an empty string (no
nil
, and no actual definitions).