mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-26 07:55:50 +03:00
[PR #529] [MERGED] Fix: Handle whitespace-only tags from Proxmox API to prevent false Terraform diffs #529
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#529
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/529
Author: @aleskxyz
Created: 12/4/2025
Status: ✅ Merged
Merged: 12/16/2025
Merged by: @Tinyblargon
Base:
master← Head:fix-tags📝 Commits (1)
9a85e6eFix: Handle whitespace-only tags from Proxmox API📊 Changes
1 file changed (+13 additions, -4 deletions)
View changed files
📝
proxmox/type__tag.go(+13 -4)📄 Description
Problem
Proxmox API sometimes (when you set tag for VMs/containers and then remote it) returns
"tags": " "(a single space character) for VMs/containers that have no tags set. This causes false diffs in Terraform when the provider compares the state with the configuration:The issue occurs because the SDK's
mapToSDKfunction was treating the whitespace string as a valid tag, creating aTagsslice with a single tag containing a space character.Solution
Updated
Tags.mapToSDK()inproxmox/type__tag.goto:Tags{}when the input is only whitespaceThis ensures that when Proxmox returns
"tags": " ", it's correctly interpreted as "no tags" rather than "one tag with a space".Test
Before:
After:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.