Commit Graph

18 Commits

Author SHA1 Message Date
James Bardin
43d93b2036 remove excess logging from dag
The dag Update messages were not particularly helpful in the debugging
of terraform, and since we're going to be relying on DynamicExpand to an
even greater extent, this will eliminate a log of extra log output.
2020-04-08 12:30:35 -04:00
James Bardin
26a4de803f remove uses of Set.List
Since the set can be iterated over directly, we no longer need to copy
the values into a new slice.
2020-02-19 14:53:19 -05:00
James Bardin
32ae3b5452 make dag.Set a simple map
This allows iteration directly over the set, removing the need to
allocate and copy a new slice for every iteration.
2020-02-19 14:46:35 -05:00
Karsten Jeschkies
ddfda430d4
Correct simple typo in walk.go. 2019-10-22 11:40:50 +02:00
Martin Atkins
c937c06a03 terraform: ugly huge change to weave in new HCL2-oriented types
Due to how deeply the configuration types go into Terraform Core, there
isn't a great way to switch out to HCL2 gradually. As a consequence, this
huge commit gets us from the old state to a _compilable_ new state, but
does not yet attempt to fix any tests and has a number of known missing
parts and bugs. We will continue to iterate on this in forthcoming
commits, heading back towards passing tests and making Terraform
fully-functional again.

The three main goals here are:
- Use the configuration models from the "configs" package instead of the
  older models in the "config" package, which is now deprecated and
  preserved only to help us write our migration tool.
- Do expression inspection and evaluation using the functionality of the
  new "lang" package, instead of the Interpolator type and related
  functionality in the main "terraform" package.
- Represent addresses of various objects using types in the addrs package,
  rather than hand-constructed strings. This is not critical to support
  the above, but was a big help during the implementation of these other
  points since it made it much more explicit what kind of address is
  expected in each context.

Since our new packages are built to accommodate some future planned
features that are not yet implemented (e.g. the "for_each" argument on
resources, "count"/"for_each" on modules), and since there's still a fair
amount of functionality still using old-style APIs, there is a moderate
amount of shimming here to connect new assumptions with old, hopefully in
a way that makes it easier to find and eliminate these shims later.

I apologize in advance to the person who inevitably just found this huge
commit while spelunking through the commit history.
2018-10-16 18:46:46 -07:00
Martin Atkins
2c70d884d6 dag: node visits return diagnostics rather than errors
This allows node visits to also return warnings.
2018-10-16 18:44:26 -07:00
Radek Simko
93613ee526
terraform+dag: Set lower log levels 2017-08-14 11:43:45 +02:00
Edward Betts
be265479a9 correct spelling mistakes (#13979) 2017-04-27 02:10:04 +12:00
Mitchell Hashimoto
6702a22074
dag: require acyclic graph 2017-02-03 21:18:34 +01:00
Mitchell Hashimoto
07ce5a7624
dag: cleanup some code that had no effect anymore 2017-02-03 21:18:34 +01:00
Mitchell Hashimoto
6366488809
dag: Update can be called with a nil graph 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto
65752cd51a
dag: improve docs and read access during a lock 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto
72a717f2de
dag: change the type sig of Update to Graph so its external friendly 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto
28fff99ea8
dag: replace dag.Walk with our walker 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto
b1aa6fd598
dag: improved comments 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto
7f61f11723
dag: support removing edges 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto
5d49e7e6b6
dag: tests for adding edges/vertices during walk-time 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto
cbc71d9508
dag: basic working update-able walker 2017-02-03 21:18:33 +01:00