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. 05 Apr, 2019 2 commits
    • Matthew Sanabria's avatar
    • Martin Atkins's avatar
      configs/configupgrade: Normalize number literals to decimal · 26c1e40a
      Martin Atkins authored
      The v0.12 language supports numeric constants only in decimal notation, as
      a simplification. For rare situations where a different base is more
      appropriate, such as unix-style file modes, we've found it better for
      providers to accept a string containing a representation in the
      appropriate base, since that way the interpretation can be validated and
      it will be displayed in the same way in the rendered plan diff, in
      outputs, etc.
      
      We use tv.Value() here to mimick how HCL 1 itself would have interpreted
      these, and then format them back out in the canonical form, which
      implicitly converts any non-decimal constants to decimal on the way
      through.
      26c1e40a
  2. 04 Apr, 2019 3 commits
    • Martin Atkins's avatar
    • Martin Atkins's avatar
      website: Documentation of the special "attributes as blocks" mode · 99f2623d
      Martin Atkins authored
      The re-introduction of some of the ambiguity between argument and nested
      block syntax (for compatibility with existing provider patterns)
      unfortunately leads to some interesting consequences for attributes using
      this mode.
      
      While the behavior is generally as before in straightforward cases, this
      page aims to spell out some of the different usage patterns explicitly
      for the benefit of those writing more complex configurations, such as
      generic re-usable modules where using argument vs. block syntax leads to
      some real differences.
      
      This page is intentionally not linked from anywhere in the part of the
      website maintained in the Terraform repository. Instead, it can be linked
      from the provider documentation for any argument where this pattern is
      used, to help users understand the ways in which that argument might
      deviate from the usual behaviors of arguments vs. nested blocks.
      99f2623d
    • Jeff's avatar
      Fix docs typo (#20924) · 3110dde1
      Jeff authored
      * fix docs typo
      
      * restore trailing newline
      3110dde1
  3. 03 Apr, 2019 11 commits
  4. 02 Apr, 2019 6 commits
    • James Bardin's avatar
      Merge pull request #20906 from hashicorp/jbardin/grpc-recv-limit · 7ced4642
      James Bardin authored
      increase grpc recv limit
      7ced4642
    • James Bardin's avatar
      add 3rd param to mock call · 2ebc2bed
      James Bardin authored
      2ebc2bed
    • James Bardin's avatar
      increase grpc recv limit · 746aac8b
      James Bardin authored
      Some providers may generate quite large schemas, and the internal
      default grpc response size limit is 4MB. 64MB should cover most any use
      case, and if we get providers nearing that we may want to consider a
      finer-grained API to fetch individual resource schemas.
      746aac8b
    • James Bardin's avatar
      Merge pull request #20904 from hashicorp/jbardin/filter-shim-nulls · 34358254
      James Bardin authored
      filter nulls when shimming a config
      34358254
    • James Bardin's avatar
      filter nulls when shimming a config · 97bde546
      James Bardin authored
      Nulls can't exist in HCL, and the legacy sdk will panic when
      encountering them. The map shim already did this, just copy the same
      pattern in the list case.
      97bde546
    • Brian Flad's avatar
      helper/schema: Prevent setSet() panic with typed nil · a8e3787a
      Brian Flad authored
      References:
      
      * https://github.com/hashicorp/terraform/issues/14418
      * v0.9.5 (original bug report): https://github.com/hashicorp/terraform/blob/a59ee0b30e1350d18e44a3a2a405124302751f93/helper/schema/field_writer_map.go#L311
      * v0.11.12 (Terraform AWS Provider discovery): https://github.com/hashicorp/terraform/blob/057286e5228559722bfc9bf6a03679650358c9d2/helper/schema/field_writer_map.go#L343
      
      When creating flatten functions in Terraform Providers that return *schema.Set, its possible to return a typed `nil`, e.g.
      
      ```go
      func flattenHeaders(h *cloudfront.Headers) *schema.Set {
      	if h.Items != nil {
      		return schema.NewSet(schema.HashString, flattenStringList(h.Items))
      	}
      	return nil
      }
      ```
      
      This previously could cause a panic, e.g.
      
      ```
      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1881911]
      
      goroutine 1325 [running]:
      github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setSet(0xc00054bf00, 0xc00073efa0, 0x5, 0x5, 0x5828140, 0x0, 0xc0002cea50, 0xc000e996a8, 0xc001026e40)
      	/Users/bflad/go/pkg/mod/github.com/hashicorp/terraform@v0.11.12/helper/schema/field_writer_map.go:343 +0x211
      ```
      
      Here we catch the typed `nil` and return an empty list flatmap result instead. Unit testing result prior to code update:
      
      ```
      --- FAIL: TestMapFieldWriter (0.00s)
      panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1777cdc]
      
      goroutine 913 [running]:
      testing.tRunner.func1(0xc00045b800)
        /usr/local/Cellar/go/1.12.1/libexec/src/testing/testing.go:830 +0x392
      panic(0x192cf20, 0x2267ca0)
        /usr/local/Cellar/go/1.12.1/libexec/src/runtime/panic.go:522 +0x1b5
      github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setSet(0xc0004648a0, 0xc0004408d0, 0x1, 0x1, 0x19e3de0, 0x0, 0xc00045c600, 0x30, 0x19e0080)
        /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:344 +0x68c
      github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).set(0xc0004648a0, 0xc0004408d0, 0x1, 0x1, 0x19e3de0, 0x0, 0x1, 0x18)
        /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:107 +0x28b
      github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).WriteField(0xc0004648a0, 0xc0004408d0, 0x1, 0x1, 0x19e3de0, 0x0, 0x0, 0x0)
        /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:89 +0x504
      github.com/hashicorp/terraform/helper/schema.TestMapFieldWriter(0xc00045b800)
        /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map_test.go:337 +0x2ddd
      testing.tRunner(0xc00045b800, 0x1a44f90)
        /usr/local/Cellar/go/1.12.1/libexec/src/testing/testing.go:865 +0xc0
      created by testing.(*T).Run
        /usr/local/Cellar/go/1.12.1/libexec/src/testing/testing.go:916 +0x35a
      ```
      a8e3787a
  5. 01 Apr, 2019 4 commits
  6. 29 Mar, 2019 11 commits
  7. 28 Mar, 2019 3 commits