Commit Graph

14 Commits

Author SHA1 Message Date
Mitchell Hashimoto 2019a44f04
command/apply: apply from plan respects -backup and -state-out
Fixes #5409

I didn't expect this to be such a rabbit hole!

Based on git history, it appears that for "historical reasons"(tm),
setting up the various `state.State` structures for a plan were
_completely different logic_ than a normal `terraform apply`. This meant
that it was skipping things like disabling backups with `-backup="-"`.

This PR unifies loading from a plan to the normal state setup mechanism.
A few tests that were failing prior to this PR were added, no existing
tests were changed.
2016-10-28 20:51:05 -04:00
James Bardin 6b5ee73e86 Use -state-out option when applying from a plan
When working from an existing plan, we weren't setting the PathOut field
for a LocalState. This required adding an outPath argument to the
StateFromPlan function to avoid having to introspect the returned
state.State interface to find the appropriate field.

To test we run a plan first and provide the new plan to apply with
`-state-out` set.
2016-07-01 14:18:51 -04:00
Anthony Scalisi 198e1a5186 remove various typos 2015-09-11 11:56:20 -07:00
Mitchell Hashimoto e91b5136bf Merge pull request #1356 from koendc/b-remote-plugin-case
command/state: fix for state files containing an upper case remote type
2015-04-14 08:34:28 -07:00
Mitchell Hashimoto 1fac7b6488 state: cache should use State.Equal to check equality
reflect.DeepEqual was returning false, sometimes.
2015-04-07 15:03:04 -07:00
Koen De Causmaecker 428fd98ba0 Handles upper case characters in the cached state file's remote type
If the cached state file contains a remote type field with upper case
characters, eg 'Consul', it was no longer possible to find the 'consul'
remote plugin.
2015-04-01 21:42:39 +02:00
Seth Vargo 1adb3fbfa0 command: when setting up state, only write back if local is newer 2015-03-26 17:16:54 -07:00
Mitchell Hashimoto 8e76a02a56 command: disable backup with "-" [GH-1072]
/cc @phinze
2015-03-02 09:11:49 -08:00
Mitchell Hashimoto 2c2b560d7f command/remote: no more remote package 2015-02-23 15:13:55 -08:00
Mitchell Hashimoto f2c6c12535 command/pull: remove remote package 2015-02-23 15:13:55 -08:00
Mitchell Hashimoto 3550f7ac3a command: FlagVar => FlagKV 2015-02-23 15:13:54 -08:00
Mitchell Hashimoto f81110c2fe command: backup stuff works better 2015-02-23 15:13:54 -08:00
Mitchell Hashimoto 4ec63bc2ef command: deal with plan states 2015-02-23 15:13:54 -08:00
Mitchell Hashimoto 579f102f37 command: start migrating to new state package 2015-02-23 15:13:54 -08:00