Commit Graph

330 Commits

Author SHA1 Message Date
Mitchell Hashimoto 968a152df4 Merge pull request #1443 from hashicorp/f-acc-tests-check-empty-plan
providers: check for empty plan after each test step
2015-04-14 08:30:11 -07:00
Sander van Harmelen d90b3aa332 Merge pull request #1469 from svanharmelen/b-communicator-tests
Fixing up the communicator tests
2015-04-09 23:46:59 +02:00
Sander van Harmelen 02a41a8802 Fixing up the communicator tests
It turned out the tests didn’t work as expected due to some missing
config in the `newMockLineServer` and a defer located in the wrong
location. All is good again now…
2015-04-09 23:40:40 +02:00
Mitchell Hashimoto db58c7dd33 providers/docker: default cert_path to non-nil so input isn't asked 2015-04-09 09:49:03 -07:00
Paul Hinze 7fe34d4547 providers: check for empty plan after each test step
Each acceptance test step plays a Refresh, Plan, Apply for a given
config. This adds a follow up Plan and fails the test if it does not
come back empty. This will catch issues with perpetual, unresolvable
diffs that crop up here and there.

This is going to cause a lot of our existing acceptance tests to fail -
too many to roll into a single PR. I think the best plan is to land this
in master and then fix the failures (each of which should be catching a
legitimate provider bug) one by one until we get the provider suites
back to green.
2015-04-09 10:19:01 -05:00
Paul Hinze 66dbf91ffd helper/schema: ensure ForceNew set when Update is not
If a given resource does not define an `Update` function, then all of
its attributes must be specified as `ForceNew`, lest Applys fail with
"doesn't support update" like #1367.

This is something we can detect automatically, so this adds a check for
it when we validate provider implementations.
2015-04-03 09:57:30 -05:00
Tarrant f68c9eee63 Merge branch 'master' of https://github.com/hashicorp/terraform 2015-04-01 18:24:57 -07:00
Tarrant 6ad812e3d8 Merge branch 'ssh_agent' 2015-03-31 17:49:55 -07:00
Paul Hinze 97acccd3ed core: targeted operations
Add `-target=resource` flag to core operations, allowing users to
target specific resources in their infrastructure. When `-target` is
used, the operation will only apply to that resource and its
dependencies.

The calculated dependencies are different depending on whether we're
running a normal operation or a `terraform destroy`.

Generally, "dependencies" refers to ancestors: resources falling
_before_ the target in the graph, because their changes are required to
accurately act on the target.

For destroys, "dependencies" are descendents: those resources which fall
_after_ the target. These resources depend on our target, which is going
to be destroyed, so they should also be destroyed.
2015-03-31 14:49:38 -05:00
Tarrant 05407296c6 Add cleanup function to close SSHAgent 2015-03-20 18:18:35 -07:00
Paul Hinze 3ba8ed536b helper/schema: record schema version on apply
We were previously only recording the schema version on refresh. This
caused the state to be incorrectly written after a `terraform apply`
causing subsequent commands to run the state through an unnecessary
migration.
2015-03-18 19:08:48 -05:00
Tarrant 164f303da4 Add SSH Agent support 2015-03-15 16:12:59 -07:00
Paul Hinze 558775d115 Merge pull request #1184 from hashicorp/f-update-ssh-import
helper/ssh: update import location
2015-03-11 16:57:12 -05:00
Paul Hinze a24c21bd2c Merge pull request #1152 from hashicorp/f-helper-schema-versioning
helper/schema: schema versioning & migration
2015-03-11 15:54:22 -05:00
Paul Hinze 85caf9d8d7 helper/ssh: update import location
go's ssh package now lives canonically at `golang.org/x/crypto/ssh`

see https://godoc.org/golang.org/x/crypto/ssh

closes #1179
2015-03-11 15:48:47 -05:00
Paul Hinze 3d4b55e557 helper/schema: schema versioning & migration
Providers get a per-resource SchemaVersion integer that they can bump
when a resource's schema changes format. Each InstanceState with an
older recorded SchemaVersion than the cureent one is yielded to a
`MigrateSchema` function to be transformed such that it can be addressed
by the current version of the resource's Schema.
2015-03-06 16:26:11 -06:00
Paul Hinze ef70c8cae5 helper/schema: allow Schema attrs to be Removed
Removed fields show a customizable error message to the user when they
are used in a Terraform config. This is a tool that provider authors can
use for user feedback as they evolve their Schemas.

refs #957
2015-03-05 15:33:56 -06:00
Paul Hinze 888f16d2d3 helper/schema: allow Schema attrs to be Deprecated
Deprecated fields show a customizable warning message to the user when
they are used in a Terraform config. This is a tool that provider
authors can use for user feedback as they evolve their Schemas.

fixes #957
2015-03-05 15:16:50 -06:00
Paul Hinze 000238835c helper/schema: [tests] add names to Validate tests
a process also known as 'paulification' :)
2015-03-05 12:28:53 -06:00
Mitchell Hashimoto 58a8776c41 helper/schema: test real nil pointer to ResourceData.Set 2015-03-02 23:37:43 -08:00
Mitchell Hashimoto c030148259 helper/schema: allow pointer values to ResourceData.Set 2015-03-02 21:06:14 -08:00
Mitchell Hashimoto 2feaebdca5 config: substring containing computed value replaces element 2015-02-27 21:51:14 -08:00
Jack Pearkes c180487af6 helper/resource: allow configuration of not found checks in state change 2015-02-26 09:59:42 -08:00
Mitchell Hashimoto 0bc0c03fec helper/schema: zero value set should set function [GH-1009] 2015-02-19 11:26:02 -08:00
Mitchell Hashimoto 9b8b38cbb1 helper/schema: test that set can be nil 2015-02-18 14:59:55 -08:00
Mitchell Hashimoto e4f0f6b15d helper/schema: more tests 2015-02-18 14:44:46 -08:00
Mitchell Hashimoto dd00001c9a helper/schema: tests that all pass as I was trying to track down a bug 2015-02-18 14:10:12 -08:00
Mitchell Hashimoto 17680bb7ff helper/schema: some more test cases, revert some weird behavior from
dbfb95fcd5

I don't know why that behavior was in there, but it was breaking a lot
of existing Terraform states. Let's circle back on it.
2015-02-18 12:54:46 -08:00
Mitchell Hashimoto 659a77c6ae helper/schema: validate subresources more effectively 2015-02-18 09:41:55 -08:00
Mitchell Hashimoto fa7f496bef helper/schema: zero value of a set should be empty 2015-02-17 16:58:47 -08:00
Mitchell Hashimoto 7d32c8946a helper/schema: GetOk now only returns true if set to non-zero value 2015-02-17 16:55:39 -08:00
Mitchell Hashimoto e04def93e6 Merge pull request #991 from hashicorp/b-autoscale-lc-update
providers/aws: allow in-place update of launch configuration
2015-02-17 16:29:56 -08:00
Mitchell Hashimoto faec39b8c1 Merge pull request #990 from hashicorp/b-set-change
helper/schema: GetChange shouldn't return true when no change
2015-02-17 16:17:44 -08:00
Mitchell Hashimoto 5a64d0900b providers/aws: test for allowing in-place lC update 2015-02-17 16:12:02 -08:00
Mitchell Hashimoto 66f7731995 helper/schema: GetChange shouldn't return true when no change 2015-02-17 15:43:19 -08:00
Mitchell Hashimoto 5c06cc386a helper/schema: empty map values should show up in diff [GH-968] 2015-02-17 15:22:45 -08:00
Mitchell Hashimoto e9778c85a5 helper/schema: clarify test 2015-02-17 14:46:24 -08:00
Mitchell Hashimoto dbfb95fcd5 helper/schema: show in diff when no config is going to empty set 2015-02-17 14:45:18 -08:00
Mitchell Hashimoto fd274d7328 helper/schema: update test desc 2015-02-17 13:17:23 -08:00
Mitchell Hashimoto bcdec738d4 helper/schema: default the new value to zero only for the decode 2015-02-17 13:16:59 -08:00
Mitchell Hashimoto ad6be99f5b helper/schema: failing test 2015-02-17 13:15:30 -08:00
Mitchell Hashimoto 2ee2b9e26f Merge pull request #986 from hashicorp/b-remove-set
helper/schema: Diff with set going to 0 elements removes it from state
2015-02-17 11:50:50 -08:00
Mitchell Hashimoto 2212d6895d helper/schema: diff with set going to 0 elements removes it from state 2015-02-17 11:38:56 -08:00
Mitchell Hashimoto c22ba7d3a8 helper/schema: fix test index 2015-02-17 11:14:04 -08:00
Mitchell Hashimoto cbcfb26ec6 helper/schema: add test for sets 2015-02-17 11:12:45 -08:00
Mitchell Hashimoto b778a65a83 helper/schema: diff of zero value in state with lack of value should not
diff
2015-02-17 11:10:45 -08:00
Mitchell Hashimoto 61215d8826 Merge pull request #919 from ceh/url-helper
helper/url: add "Windows-safe" URL Parse wrapper
2015-02-17 09:26:55 -08:00
Clint Shryock 4c7b732dad typo 2015-02-11 14:49:50 -08:00
Clint Shryock 5602348695 formatting, cleanups 2015-02-11 11:40:49 -08:00
Clint Shryock a5040ecc03 Update hashcode to always generate a positive 2015-02-11 10:59:21 -08:00