mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-25 23:45:55 +03:00
[PR #138] [MERGED] LXC mountpoint boolean flag conversion #256
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#256
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Telmate/proxmox-api-go/pull/138
Author: @danclough
Created: 9/9/2021
Status: ✅ Merged
Merged: 10/5/2021
Merged by: @ggongaware
Base:
master← Head:lxc_mountpoint_fix📝 Commits (2)
d88aacfLXC mountpount int to boolean conversion6504f43Add support for other mountpoint booleans📊 Changes
1 file changed (+11 additions, -4 deletions)
View changed files
📝
proxmox/config_lxc.go(+11 -4)📄 Description
There is an issue with fetching LXC configs with certain boolean flags set because the Proxmox API represents boolean flags as an integer. This has manifested in several places, including network configs as illustrated in #97, #113 and other PRs.
I encountered this issue when attempting to create an LXC with the Proxmox Terraform provider. When a mountpoint's backup flag is set to true, the creation succeeds but Terraform fails to read in the new resource state due to a type conversion error.
This patch adds a loop to perform Itob conversion for 5 possible boolean flags encountered in the mountpoint config. For the sake of consistency, I also updated the NIC config firewall flag to use the same Itob conversion.
After recompiling this module and the Terraform Proxmox provider with the fix, I was able to successfully create an LXC with the 5 affected flags set.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.