Skip to content
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

VM annotation as heredoc triggers resource update across applies when unmodified #2252

Open
4 tasks done
arcticgeek opened this issue Aug 28, 2024 · 1 comment
Open
4 tasks done
Labels
bug Type: Bug needs-triage Status: Issue Needs Triage
Milestone

Comments

@arcticgeek
Copy link

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

1.9.5

Terraform Provider

hashicorp/vsphere 2.8.3

VMware vSphere

7.0.3 build 22357613

Description

When a multi-line virtual machine annotation is specified using a heredoc (using <<-EOT) it is correctly saved through vSphere provider, but subsequent applies of the same unmodified annotation shows changes are detected. The changes detected are apparently phantom, showing per-line changes from -value to +value in plan/apply output with the line content shown is clearly unmodified.

When the multi-line annotation is specified as a single string with inline C-style escaped line-endings (e.g.: "my multi-line\nawesome\n\nannotation"), the problem does not exist. The multi-line annotation is saved and appears as intended, and subsequent plan/apply invocations detect no changes.

Affected Resources or Data Sources

  • resource/vsphere_virtual_machine

Terraform Configuration

Example annotation demonstrating issue, lines are TAB-prefixed:

annotation = <<-EOT
	my multi-line
	awesome
	
	annotation
	EOT

Example annotation that avoids issue:
annotation = "my multi-line\nawesome\n\nannotation"

Debug Output

https://gist.github.com/arcticgeek/9c14ec830118c2a2aabb2714dcd693e9

Panic Output

No response

Expected Behavior

Multi-line VM annotations specified as heredocs should trigger no changes when unmodified across plan/apply invocations.

Actual Behavior

Phantom changes to the multi-line annotation are detected even when unmodified.

Steps to Reproduce

apply multi-line annotation to VM resource as heredoc with <<-EOT
terraform plan|apply

Environment Details

Windows AMD64 with terraform source code in UTF8 and having CRLF line endings.

Screenshots

No response

References

#713

@arcticgeek arcticgeek added bug Type: Bug needs-triage Status: Issue Needs Triage labels Aug 28, 2024
Copy link

Hello, arcticgeek! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@tenthirtyam tenthirtyam added this to the Backlog milestone Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Bug needs-triage Status: Issue Needs Triage
Projects
None yet
Development

No branches or pull requests

2 participants