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

terraform: use hcl.MergeBodies instead of configs.MergeBodies for pro… #29000

Merged
merged 2 commits into from
Jun 25, 2021

Commits on Jun 21, 2021

  1. terraform: use hcl.MergeBodies instead of configs.MergeBodies for pro…

    …vider configuration
    
    Previously, Terraform would return an error if the user supplied provider configuration via interactive input iff the configuration provided on the command line was missing any required attributes - even if those attributes were already set in config.
    
    That error came from configs.MergeBody, which was designed for overriding valid configuration. It expects that the first ("base") body has all required attributes. However in the case of interactive input for provider configuration, it is perfectly valid if either or both bodies are missing required attributes, as long as the final body has all required attributes. hcl.MergeBodies works very similarly to configs.MergeBodies, with a key difference being that it only checks that all required attributes are present after the two bodies are merged.
    
    I've updated the existing test to use interactive input vars and a schema with all required attributes. This test failed before switching from configs.MergeBodies to hcl.MergeBodies.
    mildwonkey committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    3bb8398 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2021

  1. add a command package test that shows that we can still have provider…

    …s with dynamic configuration + required + interactive input merging
    
    This test failed when buildProviderConfig still used configs.MergeBodies instead of hcl.MergeBodies
    mildwonkey committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    50cb740 View commit details
    Browse the repository at this point in the history