Commit Graph

1221 Commits

Author SHA1 Message Date
Sander van Harmelen
47dd1ad153 Add wildcard (match all) support to ignore_changes (#8599) 2016-09-02 15:44:35 +02:00
Mitchell Hashimoto
d081ad1bc0 Merge pull request #8581 from hashicorp/f-self-count
terraform: self.count works in interpolations [GH-5283]
2016-08-31 11:58:36 -07:00
Mitchell Hashimoto
60f212b73e
terraform: test for referencing counts that are from vars 2016-08-31 11:54:14 -07:00
Mitchell Hashimoto
d2e15ab69a
terraform: add test explicitly for referencing count 2016-08-31 11:49:25 -07:00
Mitchell Hashimoto
08a9c8e2c2
terraform: self.count works in interpolations [GH-5283] 2016-08-31 11:36:51 -07:00
James Bardin
632c16c212 Fix inconsistent results with self interpolation
Due to a race in interpolateForce(), a reference to self could return
inconsistent results.
2016-08-30 14:16:37 -04:00
Mitchell Hashimoto
3c2db3d572 Merge pull request #8463 from hashicorp/b-read-state-validate
Validate the state on load
2016-08-26 13:27:21 -07:00
James Bardin
f326dad2ba Merge pull request #8452 from hashicorp/jbardin/locked-copy
Add locks to state structs for copying
2016-08-25 17:06:20 -04:00
James Bardin
4559eec8be Remove the proposed LockedCopy function
We didn't add the LockedCopy function in copystructure, in favor of
using the Config struct directly.
2016-08-25 16:55:28 -04:00
James Bardin
0e6e206465 Add an InstanceState.Set method to set all fields
We con no longer copy an InstanceState via a simple
dereference+assignment because of the mutex which can't be copied. This
adds a set method to properly set all field from another InstanceState,
and take the appropriate locks while doing so.
2016-08-25 14:41:51 -04:00
James Bardin
2a47b32374 fix State.Add chart so it renders in godoc 2016-08-25 14:41:51 -04:00
James Bardin
7a579c271d Remove GoString methods from state
These method set the GoString format behavior, but they only output the
default GoString format. Remove them to prevent copying mutex values.
2016-08-25 14:41:39 -04:00
stack72
5861802d08 release: clean up after v0.7.2 2016-08-25 15:11:50 +00:00
stack72
0985f39e99
v0.7.2 2016-08-25 14:29:18 +00:00
Mitchell Hashimoto
73f7c04159
terraform: clear docs for devs 2016-08-24 18:44:54 -07:00
Mitchell Hashimoto
3376611ad0
terraform: Validate validates single module states 2016-08-24 18:42:13 -07:00
Mitchell Hashimoto
c65bbc4f0c
terraform: minor edits to reading state to prep for validation 2016-08-24 18:20:47 -07:00
James Bardin
056fd70da4 Add locks to state structs for copying
Add locks to the state structs to handle concurrency during the graph
walks. We can't embed the mutexes due to serialization constraints when
communicating with providers, so expose the Lock/Unlock methods
manually.

Use copystructure.LockedCopy to ensure locks are honored.
2016-08-24 11:15:52 -04:00
Mitchell Hashimoto
b9219103df
terraform: prefix destroy resources with module path [GH-2767] 2016-08-22 13:33:11 -07:00
Mitchell Hashimoto
f98459d683 Merge pull request #8304 from hashicorp/b-state-mv
Fix `state mv` with nested modules to work properly
2016-08-20 00:00:22 -04:00
Mitchell Hashimoto
c22ab252dd
terraform: import specific index works [GH-7691] 2016-08-19 19:14:33 -04:00
clint
146da09d5d release: clean up after v0.7.1 2016-08-19 20:28:17 +00:00
clint
55ba6ebd3d
v0.7.1 2016-08-19 19:58:17 +00:00
Mitchell Hashimoto
8afbb0ee0e
terraform: state mv "foo" to "foo.0" with single count 2016-08-19 11:54:53 -04:00
Mitchell Hashimoto
88649ed010
terraform: StateAdd edge case test for multi-count to single index 2016-08-19 11:51:31 -04:00
Mitchell Hashimoto
a22f7e8257
terraform: State.Add works with multiple resources [GH-7797] 2016-08-19 11:46:52 -04:00
Mitchell Hashimoto
4454d534fc
terraform: test for querying count resources 2016-08-19 11:41:00 -04:00
Mitchell Hashimoto
3b3f92cd9b
terraform: fix some test failures on state add with multiple modules 2016-08-18 17:39:07 -04:00
Mitchell Hashimoto
3892cc4e91
terraform: fix state add with multiple ModuleStates 2016-08-18 17:13:53 -04:00
Mitchell Hashimoto
a44c8b8760
terraform: state mv tests 2016-08-18 15:05:42 -04:00
Mitchell Hashimoto
05cbb5c0ea
terraform: add test for filtering nested modules 2016-08-17 18:54:47 -05:00
Mitchell Hashimoto
802de4ea28
terraform: fix vet 2016-08-17 12:03:21 -07:00
Mitchell Hashimoto
cc5abd0815
terraform: add tests for variables 2016-08-17 11:28:58 -07:00
Mitchell Hashimoto
af7085f671
terraform: refactor var loading out to a helper
Small style changes too
2016-08-17 11:10:26 -07:00
Mitchell Hashimoto
e6d1e77a9a
Fix vet errors found with Go 1.7 2016-08-16 18:03:22 -07:00
Mitchell Hashimoto
f4faf2274b
config: count can't be a SimpleVariable 2016-08-16 13:48:12 -07:00
James Nugent
f933b2cf16 Merge pull request #8200 from hashicorp/fix-state-rm
core: Add `terraform state rm` command
2016-08-16 19:10:17 +01:00
Paul Hinze
50df583ffd Merge pull request #8120 from hashicorp/jbardin/null-state-module
Fix panic from a null resources module in a state file
2016-08-16 09:45:52 -05:00
Mitchell Hashimoto
0a2fd1a5e5 terraform: filtering on name actually matches name 2016-08-15 14:36:23 -05:00
Paul Hinze
b9f950f1d4 Merge pull request #8167 from hashicorp/b-tainted-no-attrs-still-replaces
terraform: diffs with only tainted set are non-empty
2016-08-12 18:06:32 -05:00
Paul Hinze
3dccfa0cc9
terraform: diffs with only tainted set are non-empty
Fixes issue where a resource marked as tainted with no other attribute
diffs would never show up in the plan or apply as needing to be
replaced.

One unrelated test needed updating due to a quirk in the testDiffFn
logic - it adds a "type" field diff if the diff is non-Empty. NBD
2016-08-12 17:37:49 -05:00
James Bardin
cdb80f68a8 Ensure better state normalization
Fix checksum issue with remote state

If we read a state file with "null" objects in a module and they become
initialized to an empty map the state file may be written out with empty
objects rather than "null", changing the checksum. If we can detect
this, increment the serial number to prevent a conflict in atlas.

Our fakeAtlas test server now needs to decode the state directly rather
than using the ReadState function, so as to be able to read the state
unaltered.

The terraform.State data structures have initialization spread out
throughout the package. More thoroughly initialize State during
ReadState, and add a call to init() during WriteState as another
normalization safeguard.

Expose State.init through an exported Init() method, so that a new State
can be completely realized outside of the terraform package.
Additionally, the internal init now completely walks all internal state
structures ensuring that all maps and slices are initialized.  While it
was mentioned before that the `init()` methods are problematic with too
many call sites, expanding this out better exposes the entry points that
will need to be refactored later for improved concurrency handling.

The State structures had a mix of `omitempty` fields. Remove omitempty
for all maps and slices as part of this normalization process. Make
Lineage mandatory, which is now explicitly set in some tests.
2016-08-12 11:09:50 -04:00
James Bardin
c48a1423a1 Collapse nested if with an && 2016-08-10 16:34:21 -04:00
James Bardin
d6c8b40201 unify some of the test code
Have all the values in the testDiffFn go through the same code path
2016-08-10 11:37:55 -04:00
James Bardin
2e5791ab2b Allow the HCL input when prompted
We already accept HCL encoded input for -vars, and this expands that to
accept HCL when prompted for a value on the command line as well.
2016-08-10 11:14:31 -04:00
James Nugent
fa64ac7815 release: clean up after v0.7.0 2016-08-02 18:17:05 +00:00
James Nugent
e822a79165
v0.7.0 2016-08-02 17:59:44 +00:00
James Bardin
1af7ee87a2 Silence log output when not verbose
Set the default log package output to iotuil.Discard during tests if the
`-v` flag isn't set. If we are verbose, then apply the filter according
to the TF_LOG env variable.
2016-08-01 17:19:14 -04:00
Paul Stack
2e38467213 release: clean up after v0.7.0-rc4 2016-07-30 00:53:38 +00:00
Paul Stack
abfd2c1daf
v0.7.0-rc4 2016-07-29 23:40:54 +00:00