This project is mirrored from https://:*****@github.com/hashicorp/terraform.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
  1. 10 Dec, 2018 11 commits
  2. 08 Dec, 2018 9 commits
    • Martin Atkins's avatar
      core: Attach schemas to nodes created by ResourceCountTransformer · b1ed1469
      Martin Atkins authored
      Previously we were only doing this in the case where count wasn't set at
      all.
      b1ed1469
    • Martin Atkins's avatar
      helper/resource: print full diagnostics for operation errors in tests · f9fef561
      Martin Atkins authored
      This causes the output to include additional helpful context such as
      the values of variables referenced in the config, etc. The output is in
      the same format as normal Terraform CLI error output, though we don't
      retain a source code cache in this codepath so it will not include a
      source code snippet.
      f9fef561
    • Martin Atkins's avatar
      plugin: Fix incorrect trace log message in provider Close · 53926ea5
      Martin Atkins authored
      Was incorrectly printing out "PlanResourceChange" instead of "Close".
      53926ea5
    • Martin Atkins's avatar
      configs/configupgrade: Remove redundant list brackets · f93f7e5b
      Martin Atkins authored
      In early versions of Terraform where the interpolation language didn't
      have any real list support, list brackets around a single string was the
      signal to split the string on a special uuid separator to produce a list
      just in time for processing, giving expressions like this:
      
          foo = ["${test_instance.foo.*.id}"]
      
      Logically this is weird because it looks like it should produce a list
      of lists of strings. When we added real list support in Terraform 0.7 we
      retained support for this behavior by trimming off extra levels of list
      during evaluation, and inadvertently continued relying on this notation
      for correct type checking.
      
      During the Terraform 0.10 line we fixed the type checker bugs (a few
      remaining issues notwithstanding) so that it was finally possible to
      use the more intuitive form:
      
          foo = "${test_instance.foo.*.id}"
      
      ...but we continued trimming off extra levels of list for backward
      compatibility.
      
      Terraform 0.12 finally removes that compatibility shim, causing redundant
      list brackets to be interpreted as a list of lists.
      
      This upgrade rule attempts to identify situations that are relying on the
      old compatibility behavior and trim off the redundant extra brackets. It's
      not possible to do this fully-generally using only static analysis, but
      we can gather enough information through or partial type inference
      mechanism here to deal with the most common situations automatically and
      produce a TF-UPGRADE-TODO comment for more complex scenarios where the
      user intent isn't decidable with only static analysis.
      
      In particular, this handles by far the most common situation of wrapping
      list brackets around a splat expression like the first example above.
      After this and the other upgrade rules are applied, the first example
      above will become:
      
          foo = test_instance.foo.*.id
      f93f7e5b
    • Martin Atkins's avatar
      configs/configupgrade: Do type inference with input variables · d9603d5b
      Martin Atkins authored
      By collecting information about the input variables during analysis, we
      can return approximate type information for any references to those
      variables in expressions.
      
      Since Terraform 0.11 allowed maps of maps and lists of lists in certain
      circumstances even though this was documented as forbidden, we
      conservatively return collection types whose element types are unknown
      here, which allows us to do shallow inference on them but will cause
      us to get an incomplete result if any operations are performed on
      elements of the list or map value.
      d9603d5b
    • Martin Atkins's avatar
      configs/configupgrade: Expression type inference · a2d9634d
      Martin Atkins authored
      Although we can't do fully-precise type inference with access only to a
      single module's configuration, we can do some approximate inference using
      some clues within the module along with our resource type schemas.
      
      This depends on HCL's ability to pass through type information even if the
      input values are unknown, mapping our partial input type information into
      partial output type information by evaluating the same expressions.
      
      This will allow us to do some upgrades that require dynamic analysis to
      fully decide, by giving us three outcomes: needed, not needed, or unknown.
      If it's unknown then that'll be our prompt to emit a warning for the user
      to make a decision.
      a2d9634d
    • Martin Atkins's avatar
      lang: EvalExpr only convert if wantType is not dynamic · e63a1dfb
      Martin Atkins authored
      This actually seems to be a bug in the underlying cty Convert function
      since converting to cty.DynamicPseudoType should always just return the
      input verbatim, but it seems like it's actually converting unknown values
      of any type to be cty.DynamicVal, losing the type information.
      
      We should eventually fix this in cty too, but having this extra check in
      the Terraform layer is harmless and allows us to make progress without
      context-switching.
      e63a1dfb
    • Martin Atkins's avatar
      vendor: upgrade github.com/hashicorp/hcl2 · bf25e127
      Martin Atkins authored
      This includes a change to improve the precision of types returned from
      splat expressions when a source value is unknown.
      bf25e127
    • --global's avatar
      release: clean up after v0.12.0-alpha4 · 32d0c6fa
      --global authored
      32d0c6fa
  3. 07 Dec, 2018 5 commits
    • --global's avatar
      v0.12.0-alpha4 · 2c36829d
      --global authored
      2c36829d
    • Martin Atkins's avatar
      helper/resource: Get schemas from Terraform context · 55469cd4
      Martin Atkins authored
      Previously the test harness was preloading schemas from the providers
      before running any test steps.
      
      Since terraform.NewContext already deals with loading provider schemas,
      we can instead just use the schemas it loaded for our shimming needs,
      avoiding the need to reimplement the schema lookup behavior and thus
      the need to create a throwaway provider instance with which to do it.
      55469cd4
    • Martin Atkins's avatar
      helper/resource: Create a separate provider instance each call · a4991c57
      Martin Atkins authored
      Previously we were running the factory function only once when
      constructing the provider resolver, which means that all contexts created
      from that resolver share the same provider instance.
      
      Instead now we will call the given factory function once for each
      instantiation, ensuring that each caller ends up with a separate object
      as would be the case in real-world use.
      a4991c57
    • Sander van Harmelen's avatar
      Merge pull request #19555 from hashicorp/svh/f-entitlements · 70689f5a
      Sander van Harmelen authored
      backend/remote: use entitlements to select backends
      70689f5a
    • Martin Atkins's avatar
      states/statemgr: use -mod=vendor to run the state locking helper · e8f9fad0
      Martin Atkins authored
      This ensures that we test using the same source as we're using everywhere
      else, and more tactically also ensures that when running in Travis-CI we
      won't try to download all of the dependencies of Terraform during this
      test.
      
      In the long run we will look for a more global solution to this, rather
      than adding this to all of our embedded "go" command calls directly, but
      this is intended as a low-risk solution to get the build working again in
      the mean time.
      e8f9fad0
  4. 06 Dec, 2018 9 commits
  5. 05 Dec, 2018 6 commits