Commit Graph

483 Commits

Author SHA1 Message Date
Mitchell Hashimoto ab0b7e2d89 Merge pull request #9660 from hashicorp/b-validate-help
command/validate: respond to --help
2016-10-31 13:24:58 -07:00
Mitchell Hashimoto 314a8ed134 Merge pull request #9706 from hashicorp/b-apply-plan
command/apply: apply from plan respects -backup and -state-out
2016-10-31 13:24:24 -07:00
Calle Pettersson 51ff5cba38 Align the help string of output with documentation (#9735) 2016-10-31 11:34:56 +00:00
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
Mitchell Hashimoto b2950bc205
command/validate: respond to --help
Fixes #5072

This is very simple: we need to process CLI flags on validate in order
to catch and respond to `--help`.
2016-10-27 13:43:01 -04:00
Mitchell Hashimoto 69b32223b8 Merge pull request #9633 from hashicorp/f-experiment
helper/experiment: a helper for setting, making experiments
2016-10-27 11:22:07 -04:00
Mitchell Hashimoto 9c2014d5b6 Merge pull request #9642 from hashicorp/b-var-bool
command: FlagTypedKV parses bool as string
2016-10-27 11:17:16 -04:00
Mitchell Hashimoto f9b0207304
command: FlagTypedKV parses bool as string
When passing a bool type to a variable such as `-var foo=true`, the CLI
would parse this as a `bool` type which Terraform core cannot handle.
It would then error with an invalid type error.

This changes the handling to convert the bool to its literally string
value given on the command-line.
2016-10-26 21:45:39 -04:00
James Bardin 43f860ddfd Fix panic during "terraform show" with empty state
It's possible to have > 1 result from the StateFilter, and not have any
instances to show.
2016-10-26 17:18:36 -04:00
Mitchell Hashimoto af82be19ea
helper/experiment: a helper for setting, making experiments
This creates a standard package and interface for defining, querying,
setting experiments (`-X` flags).

I expect we'll want to continue to introduce various features behind
experimental flags. I want to make doing this as easy as possible and I
want to make _removing_ experiments as easy as possible as well.

The goal with this packge has been to rely on the compiler enforcing our
experiment references as much as possible. This means that every
experiment is a global variable that must be referenced directly, so
when it is removed you'll get compiler errors where the experiment is
referenced.

This also unifies and makes it easy to grab CLI flags to enable/disable
experiments as well as env vars! This way defining an experiment is just
a couple lines of code (documented on the package).
2016-10-26 15:47:58 -04:00
Mitchell Hashimoto aed23a0a31 Merge pull request #9527 from hashicorp/f-destroy-builder2
terraform: destroy graph builder based on state
2016-10-26 12:53:20 -04:00
Alexander Hellbom d02067a75e Add PagerDuty provider 2016-10-24 14:19:55 +02:00
Mitchell Hashimoto 1a418c1452
command/apply: -Xnew-destroy 2016-10-22 12:36:47 -07:00
Mitchell Hashimoto ae4f79e3b6
command/meta: add -shadow flag to disable shadow graph
Since it is still very much possible for this to cause problems, this
can be used to disable the shadow graph. We'll purposely not document
this since the goal is to remove this flag as we become more confident
with it.
2016-10-21 14:25:05 -07:00
Mitchell Hashimoto e8516f259d
command/apply: Xnew-apply 2016-10-19 13:39:28 -07:00
Mitchell Hashimoto ec15783f24
-Xnew-apply to enable the new apply graph 2016-10-19 13:39:28 -07:00
James Bardin f175497dd7 Fix vet issues
None were critical, but these will fail with the next version of vet.
2016-10-18 11:11:12 -04:00
James Bardin 54d50c90b1 Make TestApply_parallelism more reliable
Wait for our expected number of goroutines to be staged and ready, then
allow Run() to complete. Use a high-water-mark counter to ensure we
never exceeded the max expected concurrent goroutines at any point
during the run.
2016-10-17 18:26:16 -04:00
James Bardin 4f91507d05 Merge pull request #9268 from hashicorp/jbardin/hcl-maps
Get rid of the list when parsing HCL maps for vars
2016-10-13 14:18:29 -04:00
James Bardin 9fc50a76c3 Get rid of the list when parsing HCL maps for vars
When we parse a map from HCL, it's decoded into a list of maps because
HCL allows declaring a key multiple times to implicitly add it to a
list.  Since there's no terraform variable configuration that supports
this structure, we can always flatten a []map[string]interface{} value
to a map[string]interface{} and remove any type rrors trying to apply
that value.
2016-10-06 19:44:19 -04:00
James Bardin 286fea571f Fix push test to use something that is HCL
Fix the tfvars push test which was mistakingly using a single number to
trigger the HCL behavior.
2016-10-06 16:37:28 -04:00
James Bardin cf1cfccf06 Don't parse a TestFlagTypedKV value as a number
Don't try to parse a varibale as HCL if the value can be parse as a
single number. HCL will always attempt to convert the value to a number,
even if we later find the configured variable's type to be a string.
2016-10-06 16:27:33 -04:00
stack72 a2970e631c
Merge branch 'cwood/bitbucket-provider' of https://github.com/cwood/terraform into cwood-cwood/bitbucket-provider 2016-09-21 19:35:58 +01:00
Mitchell Hashimoto 609219fc65 command/meta: validate config immediately
* config: test for validating multi-vars (passes)

* command/plan: test invalid run

* command/meta: validate module on load
2016-09-03 15:26:49 -07:00
Mitchell Hashimoto fad1ce9915 Merge pull request #8620 from hashicorp/b-var-input
command: more resilient HCL check for inputs
2016-09-02 10:02:23 -07:00
Mitchell Hashimoto c84f699158
update HCL vendor 2016-09-02 09:58:05 -07:00
Paul Stack 05994cef31 Merge pull request #7694 from jtopjian/provider-rabbitmq
RabbitMQ Provider
2016-09-02 08:08:18 +01:00
Mitchell Hashimoto 0a2b5de67f
command: more resilient HCL check for inputs 2016-09-01 20:14:10 -07:00
Joe Topjian c2469c95f4 provider/rabbitmq: Initial Commit of RabbitMQ Provider
Contains provider configuration, a rabbitmq_vhost resource, and
acceptance test.
2016-09-01 03:19:16 +00:00
Mitchell Hashimoto 475d8750bb
command/push: make test more resilient 2016-08-26 13:38:02 -07:00
Radek Simko 8494cad8c4 Output 'destroy complete' when it's destroy (was: apply) (#8453) 2016-08-25 22:26:40 +01:00
Mitchell Hashimoto 2f8baa4580
command/push: fix tests to be vcs=false GH-8478 2016-08-25 14:09:34 -07:00
Mitchell Hashimoto 9a8209cfbd
command/push: create the proper parent directory entries in tar 2016-08-24 10:39:50 -07:00
Mitchell Hashimoto 928fdff33e
command/push: only add module directory to tar if it exists 2016-08-23 23:19:02 -07:00
Mitchell Hashimoto 92b15de080
command/push: remove the old test fixture for the new one 2016-08-23 23:16:30 -07:00
Mitchell Hashimoto a650455ed6
command/push: only explicitly include the state
modify the module include flag to flag whether we explicitly include or
exclude modules
2016-08-23 23:12:52 -07:00
Mitchell Hashimoto 3aecc52bf3
command/push: "Extra" value must be absolute 2016-08-23 22:58:58 -07:00
Mitchell Hashimoto f0de3c3e91
command/push: removed all the git stuff, turns out it doesn't matter 2016-08-23 22:51:37 -07:00
Mitchell Hashimoto e8267f4907
command/push: failing test for pushing with no modules 2016-08-23 22:49:00 -07:00
Mitchell Hashimoto 70cc108614
Revert "command/push: test that -upload-modules=false works"
This reverts commit edda576452.
2016-08-23 22:00:02 -07:00
Mitchell Hashimoto edda576452
command/push: test that -upload-modules=false works 2016-08-23 17:40:40 -07:00
Mitchell Hashimoto 2ac142abc3
command: use bufio.ReadString instead of scanning to get spaces
[GH-2628]
2016-08-22 12:59:48 -07:00
Mitchell Hashimoto d3792e4aef
command: correct outdated comment 2016-08-19 23:56:27 -04:00
Mitchell Hashimoto 43cfd3d1c9
command: fix regressions for state mv with count resource 2016-08-19 12:09:19 -04:00
Mitchell Hashimoto 0d1ea84d39
command: test for moving resource with count [GH-7797] 2016-08-19 12:05:20 -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 a44c8b8760
terraform: state mv tests 2016-08-18 15:05:42 -04: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 Stack 4d46812bab Update state_rm_test.go
Removing sort as it was imported and not used
2016-08-16 18:10:38 +01:00
Mitchell Hashimoto 3fdc08a9eb core: Add `terraform state rm` command and docs
This commit adds the `state rm` command for removing an address from
state. It is the result of a rebase from pull-request #5953 which was
lost at some point during the Terraform 0.7 feature branch merges.
2016-08-16 16:45:44 +01:00