[PR #138] [MERGED] LXC mountpoint boolean flag conversion #256

Closed
opened 2026-02-28 00:41:27 +03:00 by kerem · 0 comments
Owner

📋 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: masterHead: lxc_mountpoint_fix


📝 Commits (2)

  • d88aacf LXC mountpount int to boolean conversion
  • 6504f43 Add 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.

│ Error: mountpoint.0.backup: '' expected type 'bool', got unconvertible type 'int'
│
│   with proxmox_lxc.testlxc,
│   on main.tf line 30, in resource "proxmox_lxc" "testlxc":
│   30: resource "proxmox_lxc" "testlxc" {

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.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/138 **Author:** [@danclough](https://github.com/danclough) **Created:** 9/9/2021 **Status:** ✅ Merged **Merged:** 10/5/2021 **Merged by:** [@ggongaware](https://github.com/ggongaware) **Base:** `master` ← **Head:** `lxc_mountpoint_fix` --- ### 📝 Commits (2) - [`d88aacf`](https://github.com/Telmate/proxmox-api-go/commit/d88aacf8c269acaafb5cdb93d135936d3e34fac0) LXC mountpount int to boolean conversion - [`6504f43`](https://github.com/Telmate/proxmox-api-go/commit/6504f43b444bb41989890d36adedbe5fc3ba570e) Add support for other mountpoint booleans ### 📊 Changes **1 file changed** (+11 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/config_lxc.go` (+11 -4) </details> ### 📄 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. ``` │ Error: mountpoint.0.backup: '' expected type 'bool', got unconvertible type 'int' │ │ with proxmox_lxc.testlxc, │ on main.tf line 30, in resource "proxmox_lxc" "testlxc": │ 30: resource "proxmox_lxc" "testlxc" { ``` 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#256
No description provided.