You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note the lines which start with 'sample'. Those lines show '# whitespace change' when there have been no changes made at all.
Steps to Reproduce
This problem, whereby Terraform is unnecessarily applying changes due to perceived whitespace change, occurs when two different team members are working on two different operating systems (Unix and Windows).
On a Unix/Mac machine, make some Terraform config change and terraform apply
On the same Unix/Mac machine, do terraform plan and observe that no changes are detected - correctly.
Switch to a Windows machine, check out the latest config used in steps 1&2 and run terraform plan. Observe that it wants to make a change due to whitespace differences, as per output shown above.
The same problem occurs if working the other way round (start with Windows, switch to Unix/Mac).
Additional Context
The problem appears to be down to the way the Unix/Windows versions of Terraform each handle whitespace slightly differently when the file() function runs and a 'jsonencode' statement is produced. It happens for any resource type.
This unnecessary output clutters everything when reviewing changes and results in many more 'apply' commands being run by team members and by CI.
References
The text was updated successfully, but these errors were encountered:
Looks like the provider needs to provide a DiffSuppressFunc to suppress whitespace changes. I know this issue is a year old, but it'd be nice to see this fixed at some point.
This issue was originally opened by @nick-doyle as hashicorp/terraform#23928. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
Bearing in mind I am not actually making any Terraform config changes at this moment in time, when I run a 'terraform plan' I expect:
Actual Behavior
'terraform plan' gives:
Note the lines which start with 'sample'. Those lines show '# whitespace change' when there have been no changes made at all.
Steps to Reproduce
This problem, whereby Terraform is unnecessarily applying changes due to perceived whitespace change, occurs when two different team members are working on two different operating systems (Unix and Windows).
terraform apply
terraform plan
and observe that no changes are detected - correctly.terraform plan
. Observe that it wants to make a change due to whitespace differences, as per output shown above.The same problem occurs if working the other way round (start with Windows, switch to Unix/Mac).
Additional Context
The problem appears to be down to the way the Unix/Windows versions of Terraform each handle whitespace slightly differently when the file() function runs and a 'jsonencode' statement is produced. It happens for any resource type.
This unnecessary output clutters everything when reviewing changes and results in many more 'apply' commands being run by team members and by CI.
References
The text was updated successfully, but these errors were encountered: