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

helper/schema: Computed Map fields generate perpetual diff when empty #1607

Closed
phinze opened this issue Apr 20, 2015 · 1 comment · Fixed by #1615
Closed

helper/schema: Computed Map fields generate perpetual diff when empty #1607

phinze opened this issue Apr 20, 2015 · 1 comment · Fixed by #1615

Comments

@phinze
Copy link
Contributor

phinze commented Apr 20, 2015

This is currently breaking a bunch of acceptance tests since we've landed #1443.

For example, TestAccHerokuApp_NukeVars:

--- FAIL: TestAccHerokuApp_NukeVars (6.09s)
        testing.go:131: Step 1 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: heroku_app.foobar
                  all_config_vars.#: "" => "<computed>"

                STATE:

                heroku_app.foobar:
                  ID = terraform-test-app
                  all_config_vars.# = 0
                  config_vars.# = 0
                  git_url = [email protected]:terraform-test-app.git
                  heroku_hostname = terraform-test-app.herokuapp.com
                  name = terraform-test-app
                  region = us
                  stack = cedar-14
                  web_url = https://terraform-test-app.herokuapp.com/
FAIL

The issue centers around how helper/schema distinguishes between the following two scenarios:

  • Map is empty in config, state is nil, future value of map is unknown (should generate a diff)
  • Map is empty in config, state has been written as empty, future value of map is known to be empty (should not generate a diff)

Important locations for relevant behavior:

  • (m schemaMap) diffMap
  • (r *MapFieldReader) readMap
  • (r *MapFieldWriter) writeMap
  • (m schemaMap) finalizeDiff

Pushing a branch with a failing test and some debug logging shortly.

@ghost
Copy link

ghost commented May 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant