Commit Graph

624 Commits

Author SHA1 Message Date
Dave Cunningham aa2015ccd0 Fix failing tests 2015-01-28 16:20:14 -05:00
Dave Cunningham 3cbf1a3230 Fix missing import of math 2015-01-28 15:39:32 -05:00
Dave Cunningham 319933f551 Add some tests for TypeFloat 2015-01-28 15:22:47 -05:00
Dave Cunningham 18c26cb2eb Add some missing Float cases 2015-01-28 12:53:34 -05:00
Paul Hinze 5d4e69cc80 helper/schema: apply schema defaults at the field level when reading from config
We were waiting until the higher-level (m schemaMap) diffString method
to apply defaults, which was messing with set hashcode evaluation for
cases when a field with a default is included in the hash function.

fixes #824
2015-01-27 18:18:57 -06:00
Seth Vargo 0a7dea5532 Improve readability and purpose of multi-env default test 2015-01-22 16:09:25 -05:00
Seth Vargo 072a1cf353 Read the "standard" AWS environment variables
This is 100% backwards-compatible
2015-01-22 16:09:25 -05:00
Mitchell Hashimoto 466a54cfe4 Merge pull request #766 from hashicorp/f-exists-api
helper/schema: Exists API
2015-01-16 10:56:25 -08:00
Mitchell Hashimoto 41029f8daa helper/schema: tests for EnvDefaultFunc
/cc @jefferai - In case you care
2015-01-16 10:54:43 -08:00
Mitchell Hashimoto b3e77ef244 Merge pull request #825 from jefferai/envdefault
Move duplicated envDefaultFunc out of each provider and into Schema.
2015-01-16 10:50:43 -08:00
Mitchell Hashimoto 87948b68fc helper/schema: use interface for equality check
/cc @svanharmelen
2015-01-16 09:32:15 -08:00
Jeff Mitchell f2bd1f45ab Move duplicated envDefaultFunc out of each provider and into Schema. 2015-01-16 17:25:39 +00:00
Mitchell Hashimoto 8cba4a40f5 Merge pull request #821 from svanharmelen/b-core-haschange-getchange
core: fixing two related bugs in HasChange and GetChange
2015-01-16 09:10:06 -08:00
Mitchell Hashimoto e32cd396ad helper/schema: add test for GH-814 2015-01-16 08:37:25 -08:00
Sander van Harmelen c7550595a3 Fixing two related bugs in HasChange and GetChange
This was actually quite nasty as the first bug covered the second one…

The first bug is with HasChange. This function uses reflect.DeepEqual
to check if two instances are the same/have the same content. This
works fine for all types except for Set’s as they contain a function.
And reflect.DeepEqual will only say the functions are equal if they are
both nil (which they aren’t in a Set). So in effect it means that
currently HasChange will always say true for Set’s, even when they are
actually being equal.

As soon as you fix this problem, you will notice the second one (which
the added test is written for). Without saying you want the exact diff,
you will end up with a merged value which will (in most cases) be the
same.

Run all unit tests and a good part of the acc tests to verify this
works as expected and all look good.
2015-01-16 14:13:40 +01:00
Sander van Harmelen 2edfd0e89d Just my OCD playing up 😉 2015-01-16 13:30:11 +01:00
Greg Osuri 2769d7cf9c Fixes #813: Ensuring set count (.#) is written to the state 2015-01-16 03:43:57 -08:00
Greg Osuri f870eff5f9 core: fix for #813 - added a gaurd for interface conversion 2015-01-16 00:16:38 -08:00
Mitchell Hashimoto 448887f3c4 helper/schema: map counts in state 2015-01-15 14:12:24 -08:00
Mitchell Hashimoto 22436555a7 helper/schema: test setting computed value and retrieving it via state 2015-01-15 11:08:06 -08:00
Mitchell Hashimoto 4d067f4d6d helper/schema: don't put things into the state that don't exist or are
computed [GH-805]
2015-01-15 10:35:44 -08:00
Sander van Harmelen 133a40d77f Sets should init only once...
Currently the `sync.Once` call is only used to init a Set in the add()
func. So when you add a value to a Set that is the result of one of the
Set operations (i.e. union, difference, intersect) the Set will be
reinitialised and the exiting values will be lost.

I don’t have a clue why this is showing up in my ACC tests just now, as
this code is in there for quite some time already. Somehow it seems to
have something to do with the refactoring of the helper/schema done
last week, as I cannot reproduce this with
47f02f80bc
2015-01-15 15:33:52 +01:00
Mitchell Hashimoto 2abeb2d9ac config: use new API 2015-01-14 22:03:15 -08:00
Mitchell Hashimoto db02541d31 helper/schema: fix failing tests
/cc @svanharmelen - I think some logic changed after my refactor. I now
return Exists: true when Computed: true but the value might be blank to
note that the FieldReader FOUND a value, its just unknown. I think
before it didn't do that so the logic for GetOk has to be "does it exist
and is it _not_ computed"

Seems weird because I just realized there is no way to get the OLD value
of something if it is being computed now, but I looked and there are
tests that verify this and they're like... test #5 of Get. So, they're
not new meaning that must've been expected behavior? Hm. Let me know if
you find any other issues from acceptance tests
2015-01-14 15:38:18 -08:00
Mitchell Hashimoto 05de36b4ea Merge pull request #796 from svanharmelen/f-test-issue-791
Adding a test for issue #791
2015-01-14 15:31:28 -08:00
Mitchell Hashimoto d3c0543bf3 Merge pull request #797 from hashicorp/f-stronger-types
Force variables to be typed (internally)
2015-01-14 15:30:38 -08:00
Mitchell Hashimoto e00ee1e5ee helper/diff: fix failing test 2015-01-14 15:29:56 -08:00
Mitchell Hashimoto dbe83af829 helper/schema: fix failing tests 2015-01-14 15:28:36 -08:00
Sander van Harmelen cb37e10c6f Adding a test for issue #791
Running this test on commit 47f02f80bc
from 6 days ago, is successful, but on master it now fails.
2015-01-14 20:50:58 +01:00
Mitchell Hashimoto 241fc5bb39 helper/schema: diff floats properly
/cc @phinze - This is pretty straightforward, almost magically so. The
reason this works is because in `diffString` we use mapstructure[1] with
"weak decode mode" to just be responisble for turning anything into a
string.

[1]: https://github.com/mitchellh/mapstructure
2015-01-14 09:32:03 -08:00
Mitchell Hashimoto 6fadebc5d8 Merge pull request #769 from phinze/type-float-failing-diff-test
failing schema diff test for TypeFloat
2015-01-14 09:30:08 -08:00
Mitchell Hashimoto 5e8b300ca1 update CHANGELOG 2015-01-14 09:29:37 -08:00
Emil Hessman 2bc612e6f8 helper/schema: fix panic when validating composite type
Don't check if the root key is being computed for composite types.
Instead, continue recursing the composite type in order to check if
the sub-key, key.N, for each individual element is being computed.

Fixes a panic which occurs when validating a composite type where
the value is an unknown kind for the schema.
2015-01-13 06:59:05 +01:00
Paul Hinze bcac8c64bd failing schema diff test for TypeFloat
refs #768
2015-01-11 14:51:48 -06:00
Mitchell Hashimoto 1fcd24cf67 helper/schema: add float type 2015-01-10 16:04:01 -08:00
Mitchell Hashimoto cf94a79955 helper/schema: add TypeFloat and Zero value 2015-01-10 15:57:06 -08:00
Mitchell Hashimoto 34617b337f helper/schema: remove commit not for this branch 2015-01-10 15:53:29 -08:00
Mitchell Hashimoto 689cbc8b5b helper/schema: generate strings for ValueType 2015-01-10 15:52:11 -08:00
Mitchell Hashimoto 48b9614556 helper/schema: Exists API 2015-01-10 15:39:29 -08:00
Mitchell Hashimoto 3cbcafe989 helper/schema: remove unused field 2015-01-10 12:50:53 -08:00
Mitchell Hashimoto 361d00347a helper/schema: refactor tests for fieldreader to be common 2015-01-10 12:42:15 -08:00
Mitchell Hashimoto 9ab128899a helper/schema: make the getSource enum easier 2015-01-10 12:25:34 -08:00
Mitchell Hashimoto d89446391a helper/schema: make the get API cleaner 2015-01-10 12:22:05 -08:00
Mitchell Hashimoto 3c1b55a75f helper/schema: use the field reader/writer for state 2015-01-10 12:18:32 -08:00
Mitchell Hashimoto f64b09a045 helper/schema: more tests 2015-01-10 11:49:37 -08:00
Mitchell Hashimoto e77b2b17c4 helper/schema: remove unused method 2015-01-10 11:46:09 -08:00
Mitchell Hashimoto 03c6453a72 helper/schema: FieldWriter, replace Set 2015-01-10 11:44:26 -08:00
Mitchell Hashimoto e9a4aaaca7 helper/schema: full object test for addrToSchema 2015-01-09 17:43:44 -08:00
Mitchell Hashimoto e57f3f69b1 helper/schema: empty maps, support reading objects directly 2015-01-09 15:07:02 -08:00
Mitchell Hashimoto f0af1c36f5 helper/schema: nested resource fields should be zero-valued on get 2015-01-09 11:51:29 -08:00
Mitchell Hashimoto 942a988ac2 helper/schema: zero value of a set should be a set 2015-01-08 18:48:03 -08:00
Mitchell Hashimoto b4bf813151 helper/schema: too big to fail 2015-01-08 18:02:19 -08:00
Mitchell Hashimoto 864a8f24ec helper/schema: GoString for Set 2015-01-08 11:33:15 -08:00
Mitchell Hashimoto 7e379cb1a1 helper/schema: field readers no longer take a schema as arg 2015-01-03 12:13:46 -05:00
Mitchell Hashimoto 3ff859d734 helper/schema: MultiLevelFieldReader 2015-01-03 10:32:24 -05:00
Mitchell Hashimoto 0b1da37b20 helper/schema: diff field reader should merge result with source 2015-01-03 09:55:38 -05:00
Mitchell Hashimoto 91a57b42e8 helper/schema: reading a diff with computed should return zero value 2015-01-03 12:02:49 +05:30
Mitchell Hashimoto 73726e83b2 helper/schema: DiffFieldReader for reading data from a diff 2014-12-20 02:17:35 +05:30
Mitchell Hashimoto 9447973015 helper/schema: ConfigFieldReader and generic helpers 2014-12-19 22:52:53 +05:30
Mitchell Hashimoto 5f063d321f helper/schema: FieldReader needs to return computed status 2014-12-19 06:15:04 -05:00
Mitchell Hashimoto f416e0edf0 helper/schema: FieldReader and MapFieldReader 2014-12-19 05:56:46 -05:00
Mitchell Hashimoto e8ac16b2df helper/schema: test for empty state 2014-12-16 15:56:40 -08:00
Mitchell Hashimoto df05483cf6 helper/schema: test pass from SvH 2014-12-16 09:05:16 -08:00
Mitchell Hashimoto 913f9a923e helper/schema: remove unnecessary code 2014-12-15 17:39:07 -08:00
Mitchell Hashimoto e5877543b2 helper/schema: track map element counts
This adds "field.#" values to the state/diff with the element count of a
map. This fixes a major issue around not knowing when child elements are
computed when doing variable access of a computed map.

Example, if you have a schema like this:

    "foo": &Schema{
        Type:     TypeMap,
        Computed: true,
    }

And you access it like this in a resource:

    ${type.name.foo.computed-field}

Then Terraform will error that "field foo could not be found on resource
type.name". By adding that "foo.#" is computed, Terraform core will pick
up that it WILL exist, so its okay.
2014-12-15 17:35:16 -08:00
Sander van Harmelen 40fa6c3aaa Fixed a type and reordered the case statements
Making in more inline with the existing code…
2014-12-15 23:02:16 +01:00
Sander van Harmelen 83c760fcb3 core: refactoring the way sets work internally v2
This is a refactored solution for PR #616. Functionally this is still
the same change, but it’s implemented a lot cleaner with less code and
less changes to existing parts of TF.
2014-12-12 23:21:20 +01:00
Sander van Harmelen 4c23019ab7 core: fixing new test
Removed the ‘hashcode’ function so we didn’t need to import it here,
but also removed the needed type assertion.
2014-12-12 15:42:01 +01:00
Sander van Harmelen 54db46ef1b Fixing a small logic bug in diffList
It’s not enough to only check if no new value is set. It can also be
that a new value is set, but contains a variable that cannot be
interpolated until a depending resource is created during the apply
fase.

I actually found this one as one of the acceptance tests for the AWS
ELB resource was failing. It failed with the following error:

```
--- FAIL: TestAccAWSELB_InstanceAttaching (177.83 seconds)
  testing.go:121: Step 1 error: Error applying: aws_elb.bar: diffs
didn't match during apply. This is a bug with the resource provider,
please report a bug.
FAIL
exit status 1
FAIL  github.com/hashicorp/terraform/builtin/providers/aws  177.882s
```

After a quick look I noticed it was actually a bug in core TF so added
the test and made sure all unit tests and AWS acceptance tests are now
running successfully.
2014-12-12 15:24:29 +01:00
Mitchell Hashimoto c3ec9f7965 Revert "helper/schema: TypeMap computed should mark diff as cmputed"
This reverts commit b73078c670.
2014-12-09 09:27:19 -08:00
Mitchell Hashimoto b73078c670 helper/schema: TypeMap computed should mark diff as cmputed 2014-12-09 00:39:02 -08:00
Emil Hessman 4bfe18b40d argument and verb formatting fixes reported by go vet
builtin/providers/aws/tags_test.go:56: unrecognized printf verb 'i'
builtin/providers/aws/tags_test.go:59: unrecognized printf verb 'i'

config/config_test.go:101: possible formatting directive in Fatal call
config/config_test.go:157: possible formatting directive in Fatal call

config/module/get_file_test.go:91: missing argument for Fatalf(%s): format reads arg 1, have only 0 args

helper/schema/schema.go:341: arg v.Type for printf verb %s of wrong type: schema.ValueType
helper/schema/schema.go:656: missing argument for Errorf(%s): format reads arg 2, have only 1 args
helper/schema/schema.go:912: arg schema.Type for printf verb %s of wrong type: schema.ValueType

terraform/context.go:178: arg v.Type() for printf verb %s of wrong type: github.com/hashicorp/terraform/config.VariableType
terraform/context.go:486: arg c.Operation for printf verb %s of wrong type: terraform.walkOperation

terraform/diff_test.go💯 arg actual for printf verb %s of wrong type: terraform.DiffChangeType
terraform/diff_test.go:235: arg actual for printf verb %s of wrong type: terraform.DiffChangeType
2014-11-02 13:56:44 +01:00
Mitchell Hashimoto 1792334ec4 fmt 2014-10-21 11:00:12 -07:00
Mitchell Hashimoto 81913c58fb providers/aws: fixing faililng test 2014-10-21 10:57:55 -07:00
Mitchell Hashimoto 61811fce23 helper/schema: remove debug info 2014-10-21 10:54:44 -07:00
Mitchell Hashimoto f63a5d24e9 helper/schema: diffs for sets should include the full set [GH-457]
Prior to this, the diff only contained changed set elements. The issue
with this is that `getSet`, the internal function that reads a set from
the ResourceData, expects that each level (state, config, diff, etc.)
has the _full set_ information. This change was done to fix merging
issues.

Because of this, we need to make sure the full set is visible in the
diff.
2014-10-21 10:49:53 -07:00
Mitchell Hashimoto d0ce67a5b7 helper/schema: on destroy/create, reset state to be empty [GH-464] 2014-10-21 00:28:53 -07:00
Mitchell Hashimoto d1324678dd helper/schema: setting empty map works [GH-464] 2014-10-21 00:17:17 -07:00
Mitchell Hashimoto 9ecbbc6fa0 helper/schema: some more unit tests 2014-10-20 23:52:22 -07:00
Mitchell Hashimoto 17d1bb7dde Revert "Merge pull request #422 from svanharmelen/f-shaving-off-some-cpu-cycles"
This reverts commit 428cce2478, reversing
changes made to 517c5b2ea8.
2014-10-20 23:14:14 -07:00
Mitchell Hashimoto 428cce2478 Merge pull request #422 from svanharmelen/f-shaving-off-some-cpu-cycles
helper/schema: Shaving off some unneeded calls, saving CPU cycles
2014-10-20 23:13:18 -07:00
Mitchell Hashimoto 8f166458d2 Merge pull request #480 from hashicorp/f-fix-consul
Consul param should be "key"
2014-10-20 15:35:31 -07:00
Mitchell Hashimoto 5390357e45 helper/schema: sets properly take into account the diff 2014-10-20 15:32:30 -07:00
Mitchell Hashimoto 39edc5dc04 helper/schema: diffing maps that are computed should not result in
change
2014-10-20 14:23:06 -07:00
Mitchell Hashimoto 37930f51a1 helper/schema: test case for boolean diffs 2014-10-20 14:08:56 -07:00
Mitchell Hashimoto deec7194a3 helper/schema: validate maps properly [GH-461] 2014-10-19 20:33:00 -07:00
Mitchell Hashimoto 3e1169db61 helper/schema: validate string/bool types [GH-460] 2014-10-19 19:56:46 -07:00
Mitchell Hashimoto 686871310d terraform: input properly sends on only set input 2014-10-18 14:54:42 -07:00
Mitchell Hashimoto 2b50d44aa4 helper/schema: validate Set is a set type [GH-413] 2014-10-17 23:23:50 -07:00
Mitchell Hashimoto b4f8b7f43b helper/resource: RetryError for quitting quickly 2014-10-17 18:28:03 -07:00
Mitchell Hashimoto 2e703afdad helper/schema: valiate should ignore computed fields 2014-10-16 14:04:45 -07:00
Sander van Harmelen e003334429 Shaving off some unneeded calls, saving CPU cycles
I know it’s very unlikely that a user will notice the difference, but
why range through the list, generate the set and calculate the
hashcode, only to find out that indexMap == nil (e.g. don’t do anything
with the generated hashcode).

As indexMap is only needed when len(parts) > 0, why not only create and
fill it (in one go) when len(parts) > 0?
2014-10-16 11:54:36 +02:00
Armon Dadgar 5a3f80559c helper/ssh: Cleanups 2014-10-13 12:48:06 -07:00
Mitchell Hashimoto 12c178bc63 helper/schema: don't ask for input if provider default would not be nil 2014-10-12 17:37:52 -07:00
Mitchell Hashimoto 30786ce442 fmt 2014-10-11 10:47:07 -07:00
Mitchell Hashimoto 59349cca11 helper/schema: sets must be treated atomically within ResourceData
This fixes a seemingly minor issue (GH-255) around plans showing changes
when in fact there are none. But in reality this turned out to uncover a
really terrible bug.

The effect of what was happening was that multiple items in a set were
being merged. Now, they were being merged in the right order, so if you
didn't have rich types (lists in a set) then you never saw the effect
since the later value would overwrite the earlier. But with lists (such
as in security groups), you would end up with the lists merging. So, if
you had one ingress rule with CIDR blocks and one with SGs, then after
the merge both ingress rules would have BOTH CIDR and SGs, resulting in
an incorrect plan (GH-255).

This fixes the issue by introducing a `getSourceExact` bitflag to the
ResourceData source. When this is set, ALL data must come from this
level, instead of merging lower levels. In the case of sets and diffs,
this is exactly what you want: "Get me the set 'foo' from the config and
the config ONLY (not the state or diff or w/e)".

Andddddd its fixed.

GH-255
2014-10-11 10:40:54 -07:00
Mitchell Hashimoto 3a107d2e50 helper/schema: set the field to empty if it is a list and computed 2014-10-10 15:58:38 -07:00
Mitchell Hashimoto e5d64318bf helper/schema: don't say that a set is computed if it exists 2014-10-10 15:46:24 -07:00
Mitchell Hashimoto 36f225dea0 fmt 2014-10-10 14:50:35 -07:00
Mitchell Hashimoto e0994c717d helper/schema: fix issues around computed sets 2014-10-10 09:13:04 -07:00
Mitchell Hashimoto 539eca5ee6 Fix failing tests 2014-10-09 21:29:21 -07:00
Mitchell Hashimoto dcaf653d6f helper/schema: properly detect that a list is computed 2014-10-09 19:09:06 -07:00
Mitchell Hashimoto 3aa655ad3b helper/schema: test schema diffs with the interpolation splits 2014-10-09 16:31:24 -07:00
Mitchell Hashimoto 753f6c6f8e helper/schema: fix failing tests 2014-10-08 18:25:31 -07:00
Mitchell Hashimoto 00bdef3093 providers/aws: test tag removal 2014-10-08 18:21:21 -07:00
Mitchell Hashimoto 6eafac8a34 providers/aws: aws_vpc supports tags 2014-10-08 17:54:00 -07:00
Mitchell Hashimoto f43528957e helper/schema: support top-level TypeMap 2014-10-08 17:35:14 -07:00
Mitchell Hashimoto 0db9d98fff helper/schema: can set Partial(true) multiple times 2014-10-08 16:35:14 -07:00
Mitchell Hashimoto ef62fa80db helper/resource: add Retry function 2014-10-07 21:44:51 -07:00
Mitchell Hashimoto a7c321a028 helper/scheam: support UI defaults 2014-09-29 14:00:35 -07:00
Mitchell Hashimoto 99044a1f14 Add descriptions for AWS inputs 2014-09-29 13:30:28 -07:00
Mitchell Hashimoto 901c1448b4 command: make the UI a look nicer 2014-09-29 13:12:06 -07:00
Mitchell Hashimoto d9596fa4d0 helper/schema: don't ask for input on fields that have a value 2014-09-29 11:16:19 -07:00
Mitchell Hashimoto 5aed997223 helper/schema: Input support 2014-09-29 10:25:43 -07:00
Mitchell Hashimoto 9ba39d93b7 helper/resource: compile 2014-09-24 14:23:29 -07:00
Mitchell Hashimoto 9b2b3a963f ResourceDiff => InstanceDiff 2014-09-17 16:33:24 -07:00
Mitchell Hashimoto 81d9d70296 helper/schema: conforms to new API, tests pass 2014-09-16 17:07:13 -07:00
Mitchell Hashimoto 0bcbccf046 helper/resource: compiles, fails because Context doesn't work, probably 2014-09-16 17:02:05 -07:00
Mitchell Hashimoto 90dd00ee3c helper/diff: InstanceState conversion 2014-09-16 16:56:31 -07:00
Mitchell Hashimoto f117e33c9d helper/ssh: convert to InstanceState 2014-09-16 16:55:02 -07:00
Mitchell Hashimoto 0250c17d6e helper/schema: DefaultFunc for dynamic defaults
/cc @c4milo - This might be useful to you as well.
2014-09-09 21:33:08 -07:00
Mitchell Hashimoto 5919637456 helper/schema: Defaults [GH-245] 2014-09-09 21:17:29 -07:00
Mitchell Hashimoto 3a6940d715 helper/schema: test cases around unknown variable values 2014-08-30 17:03:01 -07:00
Mitchell Hashimoto faa4e75960 helper/schema: Get on computed diff should be empty 2014-08-27 15:45:52 -07:00
Mitchell Hashimoto c9a541d95b helper/schema: generate a full diff in destroy/create cycle 2014-08-27 15:45:52 -07:00
Mitchell Hashimoto 9d239eea60 helper/schema: detect no change computed for sets/lists properly 2014-08-27 15:03:42 -07:00
Mitchell Hashimoto 0c9b65f3f4 helper/schema: documentation 2014-08-26 21:52:09 -07:00
Mitchell Hashimoto 87a488092c helper/schema: support partial states 2014-08-26 20:19:44 -07:00
Mitchell Hashimoto 40e5608fa9 helper/schema: return the prior state if Data is an error 2014-08-26 15:50:31 -07:00
Mitchell Hashimoto 56cf1e6faa Fix go vet complaints 2014-08-24 21:50:35 -07:00
Mitchell Hashimoto 95bd64132b helper/schema: update docs 2014-08-24 16:53:42 -07:00
Mitchell Hashimoto 31cc3ffca1 helper/schema: one of Optional, Required, Computed must be set 2014-08-24 16:53:41 -07:00
Mitchell Hashimoto eff8306a6c helper/schema: don't mark things computed if an ID is set 2014-08-22 12:18:08 -07:00
Mitchell Hashimoto 9ed601d541 helper/schema: store state with processed properly 2014-08-22 12:09:06 -07:00
Mitchell Hashimoto 50026a6d5c helper/schema: When having a StateFunc, make sure NewExtra contains
original
2014-08-22 08:57:44 -07:00
Mitchell Hashimoto d009ea800a helper/schema: add support for StateFunc 2014-08-22 08:45:54 -07:00
Mitchell Hashimoto 7be2f1b091 helper/schema: add GetOk 2014-08-21 23:03:04 -07:00
Mitchell Hashimoto 37cf52fa27 helper/schema: if no ID is set then return nil 2014-08-21 22:19:33 -07:00
Mitchell Hashimoto 3d3789920d helper/schema: can set conninfo 2014-08-21 22:15:47 -07:00
Mitchell Hashimoto efaedbabb0 fmt 2014-08-20 22:24:35 -07:00
Mitchell Hashimoto 4015d942ab providers/aws: security group ingress rules treated as set [GH-87]
/cc @pearkes - !!!
2014-08-20 22:24:13 -07:00
Mitchell Hashimoto 3db41fe9f6 helper/hashcode for generating hashcodes 2014-08-20 22:09:40 -07:00
Mitchell Hashimoto e9cc09a886 helper/schema: improve InternalValidate for sets 2014-08-20 21:13:18 -07:00
Mitchell Hashimoto 9ab5577beb helper/schema: set diff tests 2014-08-20 21:09:07 -07:00
Mitchell Hashimoto 475528adc3 helper/schema: Set operations 2014-08-20 21:09:06 -07:00
Mitchell Hashimoto ca18e971d1 helper/schema: can set sets 2014-08-20 21:09:06 -07:00
Mitchell Hashimoto 9fe21f0423 helper/schema: verify that sets remove duplicates 2014-08-20 21:09:06 -07:00
Mitchell Hashimoto 56dde5c0c1 helper/schema: can read and get the state of sets 2014-08-20 21:09:06 -07:00
Mitchell Hashimoto a7e1154a0f helper/schema: remove swap tracking 2014-08-20 18:11:40 -07:00
Mitchell Hashimoto 312acf3e40 helper/schema: track map of swaps 2014-08-20 18:11:40 -07:00
Mitchell Hashimoto 5e975e47cf helper/schema: diffing should use ResourceData for guidance 2014-08-20 18:11:40 -07:00
Mitchell Hashimoto 5fc41cc272 helper/schema: properly put "id" into attributes 2014-08-20 10:38:51 -07:00
Mitchell Hashimoto 021a23fe99 helper/schema: if update sets the ID to blank, it deletes the resource 2014-08-20 10:38:51 -07:00
Mitchell Hashimoto ee0acc4a5d helper/schema: support bools 2014-08-19 16:46:36 -07:00
Mitchell Hashimoto 968a567499 helper/schema: ability to force set Meta 2014-08-19 15:26:31 -07:00
Mitchell Hashimoto e2abcb9c14 Merge pull request #163 from desimone/patch-4
helper/ssh: style
2014-08-19 12:48:18 -07:00
Alex Gaynor 2606ef8853 Remove extraneous trailing bit in the import URL 2014-08-19 12:27:01 -07:00
Alex Gaynor 3374f310f8 Replace implementation with Mitchell's go-homedir 2014-08-19 12:21:01 -07:00
Alex Gaynor f48b888477 Merge branch 'master' into expand-user-path 2014-08-19 12:19:16 -07:00
Mitchell Hashimoto 2444986fe8 helper/schema: nice error if update isn't supported 2014-08-19 09:26:48 -07:00
Mitchell Hashimoto c4664a81e6 helper/schema: show computed lists in diffs 2014-08-18 21:22:27 -07:00
Mitchell Hashimoto ba819d1f37 helper/schema: don't include zero count in state 2014-08-18 19:12:49 -07:00
Mitchell Hashimoto 5a5ef67d87 helper/schema: don't forward computing onto elements 2014-08-18 19:08:32 -07:00
Mitchell Hashimoto 801b220dc7 helper/schema: can diff lists more correctly 2014-08-18 16:54:30 -07:00
Mitchell Hashimoto e70522f4ca helper/schema: if you can't find the list, just fall through to return
nil
2014-08-18 15:46:26 -07:00
Mitchell Hashimoto 1b85f3a565 helper/schema: SetDependencies 2014-08-18 15:41:12 -07:00
Mitchell Hashimoto dfede5791c helper/schema: use reflection to set maps 2014-08-18 15:17:18 -07:00
Mitchell Hashimoto 3800dffdeb helper/schema: computed values should not be Get-able 2014-08-18 15:10:53 -07:00
Mitchell Hashimoto 4ae1673580 helper/schema: support for NewRemoved 2014-08-18 15:07:09 -07:00
Mitchell Hashimoto ce42845acd helper/schema: use reflection to build []interface{} 2014-08-18 14:24:04 -07:00
Mitchell Hashimoto 17d29f7949 helper/schema: use reflection to verify list 2014-08-18 14:21:36 -07:00
Mitchell Hashimoto 4c9271160e helper/schema: can handle maps 2014-08-18 14:00:03 -07:00
Mitchell Hashimoto 66d7003e6f helper/schema: HasChange 2014-08-18 10:00:41 -07:00
Mitchell Hashimoto f1f4836c99 helper/schema: GetChange 2014-08-18 09:58:44 -07:00
Mitchell Hashimoto 513596cc37 providers/heroku: Heroku app is mostly converted 2014-08-18 09:32:40 -07:00
Mitchell Hashimoto 3943bf5d8c helper/schema: README 2014-08-17 20:51:09 -07:00
Mitchell Hashimoto 539e4da03f helper/schema: more tests 2014-08-17 20:48:50 -07:00
Mitchell Hashimoto d321240042 helper/schema: Provider implements ResourceProvider 2014-08-17 20:23:25 -07:00
Mitchell Hashimoto c418681cc3 helper/schema: create/update/delete should work for Resource 2014-08-17 20:20:11 -07:00
Mitchell Hashimoto 894187ec18 helper/schema: Resource.Refresh 2014-08-17 19:45:26 -07:00
Mitchell Hashimoto 7db585c257 helper/schema: fix test 2014-08-17 19:32:11 -07:00
Mitchell Hashimoto afd3a7b811 helper/schema: Provider.Resources 2014-08-17 15:07:01 -07:00
Mitchell Hashimoto eaac13dd9b helper/schema: ResourceProvider.Configure 2014-08-17 15:01:27 -07:00
Mitchell Hashimoto 51a44db6c2 helper/schema: move InternalValidate to schemaMap 2014-08-17 14:50:44 -07:00
Mitchell Hashimoto e5e4437351 helper/schema: start Provider 2014-08-17 14:45:43 -07:00
Mitchell Hashimoto a33e4bcdf0 helper/schema: properly validate sub-resources 2014-08-17 14:33:54 -07:00
Mitchell Hashimoto c3f1f49640 helper/schema: final state for lists/objects works 2014-08-17 14:12:54 -07:00
Mitchell Hashimoto 06d30a559a helper/schema: Set object 2014-08-17 11:38:16 -07:00
Mitchell Hashimoto 2d74a3cadd helper/schema: basic set 2014-08-16 15:02:51 -07:00
Mitchell Hashimoto bf6ad07505 helper/schema: ResourceData.Get can get the full object 2014-08-16 13:55:10 -07:00
Mitchell Hashimoto 43e4921bd9 helper/schema: more tests, todo tests for computedwhen 2014-08-16 13:32:21 -07:00
Mitchell Hashimoto 7bc0be4b81 helper/schema: couple more tests around Computed (+ fix) 2014-08-16 09:49:22 -07:00
Mitchell Hashimoto 3a46d21527 helper/schema: computed fields cannot be set 2014-08-16 09:18:45 -07:00
Mitchell Hashimoto 90f462e609 helper/schema: detect invalid/unknown keys 2014-08-15 22:15:10 -07:00
Mitchell Hashimoto 4af387b986 helper/schema: validation 2014-08-15 22:00:16 -07:00
Mitchell Hashimoto b54acf4a0b helper/schema: better docs 2014-08-15 17:46:05 -07:00
Mitchell Hashimoto 1d9528e595 helper/schema: ResourceData.Get works in most cases 2014-08-15 17:39:08 -07:00
Mitchell Hashimoto 31067ee8f6 helper/schema: ResourceData, starting tests 2014-08-15 16:32:43 -07:00
Mitchell Hashimoto 660dc68a86 helper/schema: more tests 2014-08-15 10:39:40 -07:00
Mitchell Hashimoto d05b9d6193 helper/schema: can diff complex resource 2014-08-15 10:25:25 -07:00
Mitchell Hashimoto 878d844f5c helper/schema: comment 2014-08-14 23:33:30 -07:00
Mitchell Hashimoto 7f14708e71 helper/schema: list ForceNew 2014-08-14 23:32:20 -07:00
Mitchell Hashimoto 22e286ffd5 helper/schema: diff-ing lists at a basic level 2014-08-14 23:17:53 -07:00
Mitchell Hashimoto 46d911325a helper/schema: Bools and ints can decode 2014-08-14 20:02:52 -07:00
Mitchell Hashimoto efa2335886 helper/schema: start the Diff function 2014-08-14 19:55:47 -07:00
Mitchell Hashimoto 01b6b5f48e helper/schema: initial work 2014-08-13 14:23:22 -07:00
Alex Gaynor d578031831 Added a second test for the other form of tilde paths 2014-08-11 14:57:13 -07:00
Alex Gaynor e85b89d7fb Added a test and fixed a typo 2014-08-11 11:47:56 -07:00
Alex Gaynor 9d6e0e4e83 Fixes #179 -- expand ~'s in the path to a key file 2014-08-11 11:39:29 -07:00
Jack Pearkes 1244bff399 Merge pull request #162 from desimone/patch-3
Update communicator.go
2014-08-07 15:19:08 -04:00
bdd 462bbece95 Update communicator.go
If block ends in a return statement.  Personal preference. It's less explicit, but more concise to drop the else and outdent the return.
2014-08-07 14:29:02 -04:00
bdd 0cb0c412c3 Update communicator.go
typo
2014-08-07 14:19:08 -04:00
Mitchell Hashimoto 08c1a19cbf Merge pull request #161 from desimone/patch-2
helper/ssh: equivalent loop
2014-08-07 11:15:44 -07:00
bdd dbe946a97a Update communicator.go
Naming convention consistencies.
2014-08-07 13:53:18 -04:00
bdd b55ab5d5b4 Update password.go
Loop is equivalent.
2014-08-07 13:41:41 -04:00
bdd fd60ddaacd Update provisioner.go
Comment should be capitalized to match exported function "VerifySSH"
2014-08-07 13:19:03 -04:00
Alex Gaynor 46154ca1d3 Fixed a ton of typos in docs and comments 2014-08-07 00:19:56 -07:00
Mitchell Hashimoto a74775d077 helper/ssh: error if private key on SSH [GH-73] 2014-08-05 09:53:02 -07:00
Mitchell Hashimoto d28e5a1638 dos2unix 2014-07-28 10:43:00 -07:00
Mitchell Hashimoto b8660c2a65 helper/diff: ComputedAttrsUpdate 2014-07-24 20:25:00 -07:00
Mitchell Hashimoto c6474b3e5c terraform: more test cases 2014-07-22 08:27:16 -07:00
Mitchell Hashimoto d7ecc76148 helper/resource: refactor wait a bit and introduce delay/mintimeout 2014-07-17 11:03:30 -07:00
Mitchell Hashimoto c89e02c545 helper/diff: fix problems with PreProcess 2014-07-16 16:41:19 -07:00
Mitchell Hashimoto 2cfad3fa71 helper/diff: can specify PreProcess functions 2014-07-16 16:41:18 -07:00
Mitchell Hashimoto 9ec1990608 providers/aws/aws_instance: fix security group and key name issues in count 2014-07-16 15:21:01 -07:00
Mitchell Hashimoto e8eae17cc9 helper/config: clean up validation to work with nested items
/cc @pearkes
2014-07-16 15:08:35 -07:00
Armon Dadgar b84814539f Refactor shared SSH setup code 2014-07-16 10:33:44 -07:00
Armon Dadgar 2c3e619960 Removing unused constants 2014-07-16 10:33:44 -07:00
Armon Dadgar 8691a3ce91 Refactor helper methods out of provisioner 2014-07-16 10:33:44 -07:00
Armon Dadgar b56a7d6957 helper/ssh: Adding Connect function 2014-07-15 12:34:07 -07:00
Armon Dadgar 9ad4531d10 helper/ssh: Importing SSH stuff from Packer 2014-07-15 12:34:06 -07:00
Mitchell Hashimoto 35071f0328 helper/config: can validate array configurations 2014-07-14 18:22:05 -07:00
Mitchell Hashimoto f8b974c9aa helper/resource: never use an interval more than 10 seconds on wait 2014-07-14 13:28:48 -07:00
Mitchell Hashimoto 4f798fdec6 helper/diff: if attribute is set and also computed, don't mark computed 2014-07-11 11:46:21 -07:00
Mitchell Hashimoto f93c9c23d5 helper/diff: don't delete keys from diff if computed 2014-07-11 11:36:44 -07:00
Mitchell Hashimoto 91ad873113 helper/resource: improve logging and output for tests 2014-07-11 11:20:18 -07:00
Mitchell Hashimoto 0b2860fafc helper/config: more correct logic with regards to nested things 2014-07-10 17:05:40 -07:00
Mitchell Hashimoto dbe5a1254a helper/resource: better error if config doesn't validate 2014-07-10 17:01:21 -07:00
Mitchell Hashimoto 9ab4a5bf88 helper/resource: exponential backoff 2014-07-10 14:40:18 -07:00
Mitchell Hashimoto 63ef4cf28a helper/resource: stdlib to check resource attribute 2014-07-10 14:00:20 -07:00
Mitchell Hashimoto 4a3d51f40e helper/resource: can compose TestCheckFuncs 2014-07-10 13:29:38 -07:00
Mitchell Hashimoto 8229758806 helper/resource: refresh during test 2014-07-10 13:21:34 -07:00
Mitchell Hashimoto 83f73e63aa helper/resource: add PreCheck 2014-07-10 13:12:47 -07:00
Mitchell Hashimoto bc146d21a3 helper/resource: persist state, log 2014-07-10 11:31:07 -07:00
Mitchell Hashimoto be82499f3c helper/resource: remove debugging stuff 2014-07-10 10:31:06 -07:00
Mitchell Hashimoto 55c1bf7f79 helper/resource: more tests 2014-07-10 10:30:41 -07:00
Mitchell Hashimoto e0fbd48afd helper/resource: Acceptance test framework 2014-07-10 10:20:21 -07:00
Mitchell Hashimoto 96e09440d4 helper/diff: mark removed keys as removed 2014-07-09 09:51:36 -07:00
Mitchell Hashimoto 2d97738636 helper/diff: calculate removed keys 2014-07-09 09:47:21 -07:00
Mitchell Hashimoto fa3e9fab42 helper/resource: wait 2 seconds between each 2014-07-09 09:16:46 -07:00
Mitchell Hashimoto b700eee3e0 helper/diff: don't output ID anymore since Terraform does it 2014-07-08 16:59:58 -07:00
Mitchell Hashimoto 663be265dc helper/config: can validate nested structures
/cc @pearkes - See docs
2014-07-08 11:14:53 -07:00
Mitchell Hashimoto 7c588eca58 add readme to helper dir 2014-07-08 10:20:44 -07:00
Mitchell Hashimoto 0c812ba9e8 helper/resource: automatically validate resources
/cc @pearkes - So, just set a ConfigValidator struct up on your
resources and it'll now automatically validate.
2014-07-08 10:17:36 -07:00
Mitchell Hashimoto 50b8e761f1 helper/config: Validator
/cc @pearkes - Here is the beginning of that helper. It can't really validate
deeper keys (i.e. listeners in ELB), but my goal is for it to support that
soon. Working on it.
2014-07-08 10:02:02 -07:00
Mitchell Hashimoto f1d782031b helper/resource: don't assign to nil map 2014-07-07 20:45:09 -07:00
Mitchell Hashimoto 1c725896ca helper/resource: support waiting on absense of thing 2014-07-07 15:38:26 -07:00
Mitchell Hashimoto 8acd3a6373 helper/resource: set to valid ID 2014-07-07 15:06:17 -07:00
Mitchell Hashimoto 21539d08a8 helper/resource: add id to attributes 2014-07-07 15:00:13 -07:00
Mitchell Hashimoto 177f8c094d helper/diff: add ID to diff 2014-07-07 14:57:41 -07:00
Jack Pearkes 5ae69778a1 helper/resource: wait should return obj 2014-07-07 10:07:06 -04:00
Jack Pearkes eb7c8c07c8 helpers/resource: add wait helper 2014-07-07 10:07:06 -04:00
Mitchell Hashimoto 947fa4e669 terraform: Context introduction 2014-07-03 10:14:17 -07:00
Mitchell Hashimoto 6b42d3d9a5 helper/resource: basic tests 2014-07-02 17:36:07 -07:00
Mitchell Hashimoto cc9ef7a0d3 helper/resource: add UpdateFunc 2014-07-02 17:31:58 -07:00
Mitchell Hashimoto 37995e7ff8 helper/diff: work with complex data types 2014-07-01 16:06:06 -07:00
Mitchell Hashimoto b6a02e473d helper/resource: destroy on requiresNew 2014-06-25 18:41:40 -07:00
Mitchell Hashimoto e392c349ef helper/resource: clearer destroy logic 2014-06-24 12:59:50 -07:00
Mitchell Hashimoto cb591ab2df helper/resource: Destroy is called if destroy is set on diff 2014-06-24 12:55:59 -07:00
Mitchell Hashimoto d54034d0b5 helper/diff: comment 2014-06-24 10:33:03 -07:00
Mitchell Hashimoto bd0f23ce25 Move diff to helper/diff, helper/resource knows about it 2014-06-24 10:27:39 -07:00
Mitchell Hashimoto ae142efff7 providers/aws: know how to destroy things 2014-06-24 10:22:22 -07:00
Mitchell Hashimoto 543e70aab1 helper/resource: nice helper for resourceprovider impl 2014-06-23 19:32:49 -07:00
Mitchell Hashimoto c556e2ad48 providers/aws: start filling out 2014-06-23 19:01:57 -07:00