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

Clarify SchemaDiffSuppressFunc description #479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abitrolly
Copy link

@abitrolly abitrolly commented Jun 22, 2020

Description of oldValue and newValue arguments for SchemaDiffSuppressFund is confusing when the resource is changed outside of Terraform.

For example, if I change GitLab remote branch to "main" manually, Terraform will want to change the value back to null.

default_branch                                   = "main" -> null

The null is the old value in the state, but SchemaDiffSuppressFund oldValue argument contains the string "main".

So there are three values.

state.tfremote
nullnull"main"

SchemaDiffSuppressFund compares remote value with desired state. Not sure if it uses .tf state or current state.

https://www.terraform.io/docs/extend/schemas/schema-behaviors.html#diffsuppressfunc

@abitrolly
Copy link
Author

Although it is not explicitly mentioned, the diff is between current and planned value of remote resource, and the current value in the above case with default_branch is newer than the old planned value from Terraform config.

@abitrolly abitrolly changed the title Better description of SchemaDiffSuppressFund Better description of SchemaDiffSuppressFunc Jun 22, 2020
Base automatically changed from master to main March 22, 2021 14:01
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@abitrolly abitrolly mentioned this pull request Mar 12, 2022
@abitrolly abitrolly changed the title Better description of SchemaDiffSuppressFunc Clarify SchemaDiffSuppressFunc description Mar 16, 2022
@abitrolly abitrolly requested a review from a team as a code owner March 16, 2022 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants