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

Fix handling of ignore_changes #26387

Merged
merged 5 commits into from
Sep 29, 2020
Merged

Fix handling of ignore_changes #26387

merged 5 commits into from
Sep 29, 2020

Commits on Sep 29, 2020

  1. only ignore changes from the configuration

    ignore_changes should only exclude changes to the resource arguments,
    and not alter the returned value from PlanResourceChange. This would
    effect very few providers, since most current providers don't actively
    create their plan, and those that do should be generating computed
    values here rather than modifying existing ones.
    jbardin committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    801f60f View commit details
    Browse the repository at this point in the history
  2. diff should be from proposed, not config

    This ensures the mock provider behaves like the shimmed legacy SDK
    providers.
    jbardin committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    bc3fe5d View commit details
    Browse the repository at this point in the history
  3. apply ignore_changes directly to config

    In order to ensure all the starting values agree, and since
    ignore_changes is only meant to apply to the configuration, we need to
    process the ignore_changes values on the config itself rather than the
    proposed value.
    
    This ensures the proposed new value and the config value seen by
    providers are coordinated, and still allows us to use the rules laid out
    by objchange.AssertPlanValid to compare the result to the configuration.
    jbardin committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    9812463 View commit details
    Browse the repository at this point in the history
  4. add validation for ignore_changes references

    Ensure that ignore_changes only refers to arguments set in the
    configuration.
    jbardin committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    7fa4c00 View commit details
    Browse the repository at this point in the history
  5. don't use ignore_changes during replacement

    When replacing an instance, we have to be sure to use the original
    configuration which hasn't been processed with ignore_changes.
    jbardin committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    a8981a9 View commit details
    Browse the repository at this point in the history