Commit Graph

2752 Commits

Author SHA1 Message Date
Emil Hessman 65878791c0 Makefile: add vet target
Add a vet target in order to catch suspicious constructs
reported by go vet.

Vet has successfully detected problems in the past,
for example, see

  482460c4c8
  fc36b1cd94
  68a41035a9
  7b704fb77d
  4f3f85b165
  95fa353ee9
  4bfe18b40d

Some vet flags are noisy. In particular, the following flags
reports a large amount of generally unharmful constructs:

  -assign: check for useless assignments
  -composites: check that composite literals used field-keyed
               elements
  -shadow: check for shadowed variables
  -shadowstrict: whether to be strict about shadowing
  -unreachable: check for unreachable code

In order to skip running the flags mentioned above, vet is
invoked on a directory basis with 'go tool vet .' since package-
level type-checking with 'go vet' doesn't accept flags.

Hence, each file is vetted in isolation, which is weaker than
package-level type-checking. But nevertheless, it might catch
suspicious constructs that pose a real problem.

The vet target runs the following flags on the entire repo:

  -asmdecl: check assembly against Go declarations
  -atomic: check for common mistaken usages of the
           sync/atomic package
  -bool: check for mistakes involving boolean operators
  -buildtags: check that +build tags are valid
  -copylocks: check that locks are not passed by value
  -methods: check that canonically named methods are canonically
            defined
  -nilfunc: check for comparisons between functions and nil
  -printf: check printf-like invocations
  -rangeloops: check that range loop variables are used correctly
  -shift: check for useless shifts
  -structtags: check that struct field tags have canonical format
               and apply to exported fields as needed
  -unsafeptr: check for misuse of unsafe.Pointer

Now and then, it might make sense to check the output of

VETARGS=-unreachable make vet

manually, just in case it detects several lines of dead code etc.
2015-01-16 22:20:32 +01:00
Mitchell Hashimoto 514f6e7b22 update CHANGELOG 2015-01-16 10:57:21 -08: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 fb3f10efb0 command/apply: ask for user variables before validation [GH-736] 2015-01-16 10:46:38 -08:00
Mitchell Hashimoto 63344a37c6 config/lang: verify single quotes syntax error [GH-613] 2015-01-16 10:28:00 -08:00
Mitchell Hashimoto 90138825a2 command/apply: don't init if no args given [GH-780]
I really don't know how to unit test this since I don't know what input
triggers this except that it has been reporting a few times in the wild.
2015-01-16 10:22:20 -08:00
Mitchell Hashimoto 91a3405e88 config: understand provisioner blocks in JSON [GH-807] 2015-01-16 10:14:48 -08:00
Mitchell Hashimoto 58649132cf update CHANGELOG 2015-01-16 09:59:03 -08:00
Mitchell Hashimoto dc036a0dd0 terraform: fix bug with crash with no providers [GH-786] 2015-01-16 09:56:51 -08:00
Mitchell Hashimoto a7cad594df update Makefile to better switch to correct branch on updatedeps 2015-01-16 09:38:20 -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 35490f7812 updatedeps should checkout the last checked out branch [GH-816] 2015-01-16 09:07:12 -08:00
Sander van Harmelen 8e7ffc24a5 Merge pull request #823 from svanharmelen/f-provider/cloudstack-managed-fw
provider/cloudstack: managed fw and adding/updating docs
2015-01-16 17:53:42 +01:00
Mitchell Hashimoto fd1156ed05 Merge pull request #815 from gkze/master
Add zsh completion support
2015-01-16 08:38:47 -08:00
Mitchell Hashimoto e32cd396ad helper/schema: add test for GH-814 2015-01-16 08:37:25 -08:00
Mitchell Hashimoto b6e591e03f CL spacing 2015-01-16 08:34:24 -08:00
Mitchell Hashimoto 1525280a49 update cHANGELOG 2015-01-16 08:34:05 -08:00
Mitchell Hashimoto 61e91017be Merge pull request #804 from PeoplePerHour/f-aws-elb-subnet
providers/aws: elb subnet change should not force a new resource
2015-01-16 08:33:32 -08:00
Sander van Harmelen edc8b91d09 Adding/updating the docs to reflect the changes in the provider 2015-01-16 17:23:27 +01:00
Panagiotis Moustafellos a49f1b5dd8 epic typo 2015-01-16 16:07:55 +02: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 49b3afe452 Merge pull request #820 from svanharmelen/f-core-ocd-fixups
core: ocd fixups, cosmetic only
2015-01-16 13:35:58 +01:00
Sander van Harmelen 2edfd0e89d Just my OCD playing up 😉 2015-01-16 13:30:11 +01:00
Sander van Harmelen 8f223c020b Extending the managed firewall option
It’s now also possible to don’t give any rules, when the firewall is
configured with `managed = true`. This will in effect mean; make sure
no rules exist at all for the firewall.
2015-01-16 13:26:43 +01:00
Sander van Harmelen b29c490f2d Merge pull request #814 from gosuri/master
core: fix for #813 - added a gaurd for interface conversion
2015-01-16 13:08:51 +01:00
Greg Osuri 2769d7cf9c Fixes #813: Ensuring set count (.#) is written to the state 2015-01-16 03:43:57 -08:00
gkze 6fa8aa5b3e Add zsh completion support 2015-01-16 00:34:32 -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 89c3766b66 Merge pull request #811 from hashicorp/b-computed-map-counts
helper/schema: map counts in state
2015-01-15 14:28:11 -08:00
Mitchell Hashimoto 448887f3c4 helper/schema: map counts in state 2015-01-15 14:12:24 -08:00
Sander van Harmelen 7c34ce307b Merge pull request #810 from svanharmelen/f-revert-go1.4-check
Clean up the Go 1.4 check...
2015-01-15 22:08:54 +01:00
Sander van Harmelen d823db5963 Removed obsolete chars 2015-01-15 22:03:43 +01:00
Sander van Harmelen 7013326c06 Let's clean up Go 1.4 checks...
No need for these as the project will not build without Go 1.4 anyway
now…
2015-01-15 22:00:08 +01:00
Sander van Harmelen e4867b6fbc Merge pull request #809 from svanharmelen/f-provider/cloudstack-extend-features
provider/cloudstack: extend features and adding a new resource
2015-01-15 21:51:51 +01:00
Sander van Harmelen ab8977eed6 Last tweaks needed to get through all acc tests
Needed to tweak a few things in order get all tests running OK and to
be able to handle the latest changes in master. All is good again now…
2015-01-15 21:46:06 +01:00
Sander van Harmelen f8cd9ebbc0 Merge pull request #808 from hashicorp/b-weird-getok
helper/schema: don't put things into the state that don't exist or are computed
2015-01-15 21:44:12 +01: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
Mitchell Hashimoto 943e62222b update cHANGELOG 2015-01-15 09:48:03 -08:00
Mitchell Hashimoto 7f9abbb99c config/lang; missed file 2015-01-15 09:40:36 -08:00
Mitchell Hashimoto a2e40ad731 config: multi-variable access in slice validation fixed [GH-798] 2015-01-15 09:40:13 -08:00
Mitchell Hashimoto 5c0fc0cfe0 Merge pull request #806 from svanharmelen/b-helper-schema-sets-init
core: sets should init only once...
2015-01-15 07:48:56 -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
Panagiotis Moustafellos cedf3a9415 providers/aws: elb subnet change acceptance test
add listeners

add orig subnet
2015-01-15 16:02:47 +02:00
Sander van Harmelen 19776ba402 Updating some logic and tests
These fixes are needed to make the provider work with master again.
These are still some issues, but they seem not to be related to the
provider, but the changes in `helper/schema`.
2015-01-15 11:29:04 +01:00
Sander van Harmelen 3898098c78 Adding the ability to manage the whole firewall
This goes for the normal firewall, the egress firewall and the network
ACL.

USE WITH CAUTION! When setting `managed = true` in your config, it
means it will delete all firewall rules that are not in your config, so
unknown to TF.

Also adding the new `cloudstack_egress_firewall` resource with this
commit and updating go-cloudstack to the latest API version (v4.4)
2015-01-15 10:04:09 +01:00