Commit Graph

24216 Commits

Author SHA1 Message Date
Radek Simko 02437f067e
vendor: github.com/google/go-cmp@v0.3.0 2019-05-27 20:35:42 -05:00
Radek Simko f3fb3f8ccf
Merge pull request #21470 from hashicorp/vendor-go-mock
vendor: github.com/golang/mock@v1.3.1
2019-05-27 20:24:56 -05:00
Radek Simko 37f19cb9f5
vendor: github.com/golang/mock@v1.3.1 2019-05-27 12:22:03 +01:00
James Bardin c017149b31 don't store prepared backend config
The backend gets to "prepare" the configuration before Configure is
called, in order to validate the values and insert defaults. We don't
want to store this value in the "config state", because it will often
not match the raw config after it is prepared, forcing unecessary
backend migrations during init.

Since PrepareConfig is always called before Configure, we can store the
config value directly, and assume that it will be prepared in the same
manner each time.
2019-05-24 14:51:18 -04:00
James Bardin ee9a618369 don't migrate backend during init without override
If the backend config hashes match during init, and there are no new
backend override options, then we assume the existing config is OK.
Since init should be idempotent, we should be able to run init with no
options or config changes, and not effect the backends at all.
2019-05-24 11:31:04 -04:00
Joe Tavin 2c176fdf4b website/0.12 upgrade: Fix typo (#21426) 2019-05-24 10:06:01 -04:00
James Bardin cefc927e48 failing test for backend re-init 2019-05-23 18:21:52 -04:00
Sander van Harmelen f68673fbe4
Update CHANGELOG.md 2019-05-23 14:38:20 +02:00
Sander van Harmelen 486b8167f3
Update CHANGELOG.md 2019-05-23 14:36:53 +02:00
Sander van Harmelen 8fd3aa91a0
Merge pull request #21234 from hashicorp/svh/f-init-v0.12
Always try to select a workspace after initialization (v0.12)
2019-05-23 14:34:31 +02:00
Radek Simko 5f2970309e
Merge pull request #21397 from Norbinsh/master
Fix invalid URL
2019-05-23 07:24:46 +01:00
Shay Elmualem 9be5d99a92
Fix invalid URL 2019-05-23 09:07:50 +03:00
Martin Atkins c7c69a5e99 release: clean up after v0.12.0 2019-05-22 20:28:49 +00:00
Martin Atkins 08918475dd
v0.12.0 2019-05-22 20:14:35 +00:00
Martin Atkins 896f849201
Correct some links in the v0.12.0 changelog
In rewriting them from their previous internal links to GitHub renderings, I neglected to remove the .md suffixes.
2019-05-22 12:44:18 -07:00
Chris Marchesi 91f1489b86
Merge pull request #21390 from hashicorp/website-add-sentinel-012-upgrade-guide-details
website: add Sentinel 0.12 upgrade guide details
2019-05-22 10:58:58 -07:00
Chris Marchesi 340aa7c598
website: add Sentinel 0.12 upgrade guide details
This adds details for using Sentinel in Terraform 0.12. It largely
links to the corresponding guide in the Terraform Enterprise
documentation.
2019-05-22 09:58:18 -07:00
James Bardin 233115ad4b
Merge pull request #21380 from hashicorp/b-always-write-state-version
always write the current state terraform_version
2019-05-21 20:11:43 -04:00
James Bardin 1e1dcfd95a always write the current state terraform_version
Any time a new state is written, the current terraform version should be
recorded.
2019-05-21 18:55:53 -04:00
Justin Weissig 7335f1fdc8 docs: fixed typo (#21297)
Spelling: varable/variable.
2019-05-21 15:55:44 -04:00
Matt Morrison af6083ef82
Add support for reading modules from GCS bucket 2019-05-21 12:24:37 -07:00
David Gillies 8b45443b21
Add GCS source support for modules 2019-05-21 12:18:49 -07:00
Justin Weissig 778cae91a8 website: fix typo in the 'terraform' block documentation page 2019-05-20 14:37:03 -07:00
Martin Atkins fe8c380fe1 website: Remove the Sentinel section from 0.12 upgrade guide
A longer-form guide will follow in the Sentinel section of the Terraform
Enterprise documentation, once it's ready. For now, this section isn't
saying anything useful since it was always just a stub for a guide we
planned to write later.
2019-05-20 14:16:56 -07:00
Martin Atkins f199030739 Changelog consolidate for the v0.12.0 final release 2019-05-17 15:22:44 -07:00
Martin Atkins 5af8bcff2f
website: correct the synopsis on the formatdate function page
Was using "format" instead of "formatdate".
2019-05-17 14:42:00 -07:00
Matt Morrison cbebb7cdf1 command/init: Don't panic if go-getter-fetched module has version constraint 2019-05-17 13:19:31 -07:00
Martin Atkins 742deca3e9 lang/funcs: Short-circuit if start or end index is unknown
Previously the type-selection codepath for an input tuple referred
unconditionally to the start and end index values. In the Type callback,
only the types of the arguments are guaranteed to be known, so any access
to the values must be guarded with an .IsKnown check, or else the function
will not short-circuit properly when an unknown value is passed.

Now we will check the start and end indices are in range when we have
enough information to do so, but we'll return an approximate result if
either is unknown.
2019-05-17 08:48:02 -07:00
Peter 02d03d2d25 website: Fix odd spacing on the provider configuration syntax page 2019-05-17 08:45:08 -07:00
James Bardin 1c77704a3b
Merge pull request #21341 from hashicorp/jbardin/update-go-cty
Fix inconsistent element types with tuple literals
2019-05-16 17:07:16 -04:00
James Bardin 1d134fea69 update go-cty 2019-05-16 16:43:28 -04:00
James Bardin c391f3a1a3 failing test for cty conversion bug 2019-05-16 16:40:17 -04:00
Martin Atkins 11cf8fd6be vendor: go get github.com/hashicorp/hcl2@master
This fixes a bug where HCL would flag a parse error if a single-line
comment appeared at the end of a file without a terminating newline.
2019-05-16 07:30:50 -07:00
Martin Atkins 32d19b9574 website: 0.12 upgrade guide about variable type constraints
The upgrade tool is assuming that a type of "list" means list(string) and
a type of "map" means map(string), because that was what we documented
those as meaning.

In practice, Terraform 0.11 was lacking some validation which allowed
more complex nested structures in some cases even though they were pretty
inconvenient to use due to other language limitations.

The upgrade tool doesn't have enough context to make a reliable decision
on this, so instead we'll rely on the upgrade guide for this. We don't
need a TF-UPGRADE-TODO comment in this case because we reserve those for
things where a subsequent operation might cause the configuration to be
misinterpred, rather than just causing an error. Instead, we'll show an
example of the comment in the upgrade guide so the reader can easily
match it, and give some advice in the guide on how to address it.
2019-05-16 07:29:42 -07:00
Martin Atkins 004c2056a7 configs/configupgrade: Use single-line syntax for empty object exprs 2019-05-16 07:29:42 -07:00
Martin Atkins bec4641867 core: Don't panic if NodeApplyableResourceInstance has no config
This is a "should never happen" case, because we shouldn't ever have
resources in the plan that aren't in the configuration, but since we've
got a report of a crash here (which went away before we got a chance to
debug it) here's just an extra guard to ensure that we'll still exit
gracefully in that case.

If we see this error crop up again in future, it'd be nice to gather a
full trace log so we can see what GraphNodeAttachResourceConfig did and
why it did not attach a configuration.
2019-05-14 16:54:12 -07:00
James Bardin 80ffe0c9fe
Merge pull request #21305 from hashicorp/jbardin/always-upgrade
always run UpgradeResourceState
2019-05-14 18:50:00 -04:00
Martin Atkins 63fa1ac418 vendor: go get github.com/hashicorp/hcl2@master
This includes a small fix to ensure the parser doesn't produce an invalid
body for block parsing syntax errors, and instead produces an incomplete
result that calling applications like Terraform can still analyze.

The problem here was affecting our version-constraint-sniffing code, which
intentionally tried to find a core version constraint even if there's a
syntax error so that it can report that a new version of Terraform is a
likely cause of the syntax error. It was working in most cases, unless
it was the "terraform" block itself that contained the error, because then
we'd try to analyze a broken hcl.Block with a nil body.

This includes a new test for "terraform init" that exercises this
recovery codepath.
2019-05-14 15:37:46 -07:00
James Bardin b9e5745b3c remove SkipCoreTypeCheck and LegacySchema
Update the test provider to match the sdk.
2019-05-14 18:19:18 -04:00
James Bardin c9e1d26c25 remove the legacy schema access
Having removed the methods, it is straightforward to mechanically update
this file to get rid of all references to the "legacy schema". There is
now only one config schema type to deal with in the sdk.
2019-05-14 18:12:57 -04:00
James Bardin c8a2f3840b remove SkipCoreTypeCheck
This experiment is no longer needed for handling computed blocks, since
the legacy SDK can't reasonably handle Dynamic types, we need to remove
this before the final release.

Remove LegacySchema functions as well, since handling SkipCoreTypeCheck
was the only thing left they were handling.
2019-05-14 18:05:30 -04:00
James Bardin 059dcf1e25 implement UpgradeResourceState in the mock provider
The default is a Noop that simply encodes the provided state
2019-05-14 18:00:01 -04:00
James Bardin ec65fb960d sdk: use core schema for json state upgrade
When handling the json state in UpgradeResourceState, the schema
must be what core uses, because that is the schema used for
encoding/decoding the json state.

When converting from flatmap to json state, the legacy schema will be
used to decode the flatmap to a cty value, but the resulting json will
be encoded using the CoreConfigSchema to match what core expects.
2019-05-14 17:59:45 -04:00
Chris Griggs e0cec2075e
Merge pull request #21302 from hashicorp/cgriggs01-stable
[Cherry-pick] Rancher2 links
2019-05-14 13:26:18 -07:00
Chris Griggs 4db9b40471
Merge pull request #21301 from hashicorp/cgriggs01-rancher2
[Website] Rancher2 provider doc links
2019-05-14 13:25:52 -07:00
Kristin Laemmert 3c83f14884
Update CHANGELOG.md 2019-05-14 16:21:22 -04:00
Kristin Laemmert 14d625c850
configs/configupgrade: preserve in-line comments for lists (#21299)
* configs/configupgrade: preserve in-line comments for lists

The configupgrade tool was not writing `LineComments` for lists. Now it
is!

Fixes #21155
2019-05-14 16:19:31 -04:00
cgriggs01 80c0af894b [Website] Rancher2 provider links 2019-05-14 11:14:32 -07:00
cgriggs01 dc4811f898 [Website] Rancher2 provider links 2019-05-14 11:13:32 -07:00
Martin Atkins bcf2aa06dd core: Call providers' UpgradeResourceState every time
Previously we tried to short-circuit this if the schema version hadn't
changed and we were already using JSON serialization. However, if we
instead call into UpgradeResourceState every time we can let the provider
or the SDK do some general, systematic normalization and cleanup steps
without always requiring a schema version increase.

What exactly would be fixed up this way is for the SDK to decide, but for
example the SDK might choose to automatically delete from the state
anything that is no longer present in the schema, avoiding the need to
write explicit state migration functions for that common case where the
remedy is always the same.

The actual update logic is delegated to the provider/SDK intentionally so
that it can evolve over time and potentially differ depending on how
each SDK thinks about schema.
2019-05-14 13:30:42 -04:00