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: write "attr.#": "0" for empty maps #1824

Merged
merged 1 commit into from
May 7, 2015

Commits on May 6, 2015

  1. helper/schema: write "attr.#": "0" for empty maps

    This fixes some perpetual diffs I saw in Atlas AccTests where an empty
    map (`map[string]interface{}{}`) was being `d.Set` for "metadata_full".
    
    Because the MapFieldWriter was not distinguishing between empty and nil,
    this trigger the "map delete" logic and no count was written to the
    state. This caused subsequent plans to improperly report a diff.
    
    Here we redefine the map delete functionality to explicitly trigger only
    on `nil`, so we catch the `.#` field for empty maps.
    phinze committed May 6, 2015
    Configuration menu
    Copy the full SHA
    f236842 View commit details
    Browse the repository at this point in the history