The attributes in the diff are %#v-formatted. This means that all `\`
characters in the Windows paths are escaped with a `\`. We need to
escape the `\` characters in cwd, module, and root before doing any
comparison work.
Fixes the following test failure on Windows:
--- FAIL: TestContextPlan_pathVar (0.00s)
context_test.go:3833: bad:
DIFF:
CREATE: aws_instance.foo
cwd: "" => "C:\\Users\\ceh\\src\\github.com\\hashicorp\\terraform\\terraform/barpath"
module: "" => "C:\\Users\\ceh\\src\\github.com\\hashicorp\\terraform\\terraform\\test-fixtures\\plan-path-var/foopath"
root: "" => "C:\\Users\\ceh\\src\\github.com\\hashicorp\\terraform\\terraform\\test-fixtures\\plan-path-var/barpath"
type: "" => "aws_instance"
STATE:
<no state>
expected:
DIFF:
CREATE: aws_instance.foo
cwd: "" => "C:\Users\ceh\src\github.com\hashicorp\terraform\terraform/barpath"
module: "" => "C:\Users\ceh\src\github.com\hashicorp\terraform\terraform\test-fixtures\plan-path-var/foopath"
root: "" => "C:\Users\ceh\src\github.com\hashicorp\terraform\terraform\test-fixtures\plan-path-var/barpath"
type: "" => "aws_instance"
STATE:
<no state>
FAIL
exit status 1
FAIL github.com/hashicorp/terraform/terraform 0.050s
Right now we yield a perpetual diff on ASGs because we're not reading
termination policies back out in the provider.
This depends on https://github.com/mitchellh/goamz/pull/218 and fixes
it.
Now that readMap filters out '#' fields, when maps are nested in sets,
we exposed a related bug where a set was iterating over nested maps and
expected the '#' key to be present in those nested maps.
By skipping _all_ count fields when iterating over set keys, all is
right with the world again.
An `InstanceDiff` will include `ResourceAttrDiff` entries for the
"length" / `#` field of maps. This makes sense, since for something like
`terraform plan` it's useful to see when counts are changing.
The `DiffFieldReader` was not taking these entries into account when
reading maps out, and was therefore incorrectly returning maps that
included an extra `'#'` field, which was causing all sorts of havoc
for providers (extra tags on AWS instances, broken google compute
instance launch, possibly others).
* fixes#914 - extra tags on AWS instances
* fixes#883 - general core issue sprouted from #757
* removes the hack+TODO from #757
This resource allows an existing Route Table to be assigned as the
"main" Route Table of a VPC. This means that the Route Table will be
used for any subnets within the VPC without an explicit Route Table
assigned [1].
This is particularly useful in getting an Internet Gateway in place as
the default for a VPC, since the automatically created Main Route Table
does not have one [2].
Note that this resource is an abstraction over an association and does not
map directly to a CRUD-able object in AWS. In order to retain a coherent
"Delete" operation for this resource, we remember the ID of the AWS-created
Route Table and reset the VPC's main Route Table to it when this
resource is deleted.
refs #843, #748
[1] http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html#RouteTableDetails
[2] http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html#Add_IGW_Routing
This package attempts to install itself to GOROOT which will fail for
non-root users. Most users will have already installed the vet tool via a
system package, so it shouldn't be necessary to 'go get' here.
Moreover, the 'vet' make target already checks that it is installed before
running it, running 'go get' if necessary.
This is the output when running 'make updatedeps' as a regular user
without this change:
```
$ make updatedeps
go get -u github.com/mitchellh/gox
go get -u golang.org/x/tools/cmd/stringer
go get -u golang.org/x/tools/cmd/vet
go install golang.org/x/tools/cmd/vet: open /usr/local/go/pkg/tool/linux_amd64/vet: permission denied
make: *** [updatedeps] Error 1
```
HgGetter tests failed on windows/amd64 using Mercurial version 3.2.4:
--- FAIL: TestHgGetter (0.11s)
get_hg_test.go:35: err: C:\Program Files\Mercurial\hg.exe exited with 255: abort: file:// URLs can only refer to localhost
--- FAIL: TestHgGetter_branch (0.11s)
get_hg_test.go:62: err: C:\Program Files\Mercurial\hg.exe exited with 255: abort: file:// URLs can only refer to localhost
FAIL
FAIL github.com/hashicorp/terraform/config/module 5.615s
This commit fixes the failures by adjusting the file:// URL to a form that
Mercurial expects.
Only adjust the URL Scheme when parsing drive letter file paths on
Windows, don't add a file scheme prefix.
FileDetector is responsible for adding the file scheme prefix.
After discussing with the very gracious @cespare over at
https://github.com/cespare/deplist/pull/2 I now understand that we can
pull off the same logic with just `go list`.
The logic is now simpler and more consistent:
* List out all packages in our repo
* For each of those packages, list their dependencies
* Filter out any dependencies that already live in this repo
* Remove duplicates
* And fetch the rest. `go get` will work out all transitive dependencies
from there
Currently when running `make updatedeps` from a branch, the dependency
list from master ends up getting used. We tried to work around this in
35490f7812, and got part way there, but
here's what was happening:
- record the current SHA
- run `go get -f -u -v ./...` which ends up checking out master
- master is checked out early in the `go get` process, which means all
subsequent dependencies are resolved from master
- re-checkout the recorded SHA
- run tests
This works in most cases, except when the branch being tested actually
changes the list of dependencies in some way.
Here we move away from letting `go get -v` walk through everything in
`./...`, instead building our own list of dependencies with the help of
`deplist`. We can then filter terraform packages out from the list, so
they don't get touched, and safely update the rest.
This should solve problems like those observed in #899 and #900.
__Note__: had to add a feature to deplist to make this work properly;
see 016ef97111
Working on getting it accepted upstream.