Merge pull request #6995 from hashicorp/govendor

deps: Migrate to govendor
This commit is contained in:
James Nugent 2016-06-03 09:56:40 -05:00
commit f01e1ec67a
8 changed files with 1632 additions and 1752 deletions

1579
Godeps/Godeps.json generated

File diff suppressed because it is too large Load Diff

5
Godeps/Readme generated
View File

@ -1,5 +0,0 @@
This directory tree is generated automatically by godep.
Please do not edit.
See https://github.com/tools/godep for more information.

View File

@ -4,6 +4,11 @@ GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
default: test vet
tools:
go get -u github.com/kardianos/govendor
go get -u golang.org/x/tools/cmd/stringer
go get -u golang.org/x/tools/cmd/cover
# bin generates the releaseable binaries for Terraform
bin: fmtcheck generate
@TF_RELEASE=1 sh -c "'$(CURDIR)/scripts/build.sh'"
@ -60,9 +65,6 @@ cover:
# vet runs the Go source code static analysis tool `vet` to find
# any common errors.
vet:
@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
go get golang.org/x/tools/cmd/vet; \
fi
@echo "go tool vet $(VETARGS) ."
@go tool vet $(VETARGS) $$(ls -d */ | grep -v vendor) ; if [ $$? -eq 1 ]; then \
echo ""; \
@ -86,4 +88,4 @@ fmt:
fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
.PHONY: bin default generate test vet fmt fmtcheck
.PHONY: bin default generate test vet fmt fmtcheck tools

View File

@ -69,13 +69,7 @@ $ make core-dev
### Dependencies
Terraform stores its dependencies under `vendor/`, which [Go 1.6+ will automatically recognize and load](https://golang.org/cmd/go/#hdr-Vendor_Directories). We use [`godep`](https://github.com/tools/godep) to manage the vendored dependencies.
Generally speaking, `godep` operations follow this pattern:
1. Get current state of dependencies into your `$GOPATH` with `godep restore`.
2. Make changes to the packages in `$GOPATH`.
3. Tell `godep` to capture those changes in the Terraform repo.
Terraform stores its dependencies under `vendor/`, which [Go 1.6+ will automatically recognize and load](https://golang.org/cmd/go/#hdr-Vendor_Directories). We use [`govendor`](https://github.com/kardianos/govendor) to manage the vendored dependencies.
If you're developing Terraform, there are a few tasks you might need to perform.
@ -83,63 +77,36 @@ If you're developing Terraform, there are a few tasks you might need to perform.
If you're adding a dependency, you'll need to vendor it in the same Pull Request as the code that depends on it. You should do this in a separate commit from your code, as makes PR review easier and Git history simpler to read in the future.
Because godep captures new dependencies from the local `$GOPATH`, you first need to `godep restore` from the master branch to ensure that the only diff is your new dependency.
To add a dependency:
Assuming your work is on a branch called `my-feature-branch`, the steps look like this:
1. Add the new package to your GOPATH:
```bash
# Get latest master branch's dependencies staged in local $GOPATH
git checkout master
git pull
godep restore -v
# Capture the new dependency referenced from my-feature-branch
git checkout my-feature-branch
git rebase master
godep save ./...
# There should now be a diff in `vendor/` with added files for your dependency,
# and a diff in Godeps/Godeps.json with metadata for your dependency.
# Make a commit with your new dependencies added
git add -A
git commit -m "vendor: Capture new dependency upstream-pkg"
# Push to your branch (may need -f if you rebased)
git push origin my-feature-branch
go get github.com/hashicorp/my-project
```
2. Add the new package to your vendor/ directory:
```bash
govendor add github.com/hashicorp/my-project/package
```
3. Review the changes in git and commit them.
#### Updating a dependency
If you're updating an existing dependency, godep provides a specific command to snag the newer version from your `$GOPATH`.
To update a dependency:
1. Fetch the dependency:
```bash
# Get latest master branch's dependencies staged in local $GOPATH
git checkout master
git pull
godep restore -v
# Make your way to the dependency in question and checkout the target ref
pushd $GOPATH/src/github.com/some/dependency
git checkout v-1.next
# Head back to Terraform on a feature branch and update the dependncy to the
# version currently in your $GOPATH
popd
git checkout my-feature-branch
godep update github.com/some/dependency/...
# There should now be a diff in `vendor/` with changed files for your dependency,
# and a diff in Godeps/Godeps.json with metadata for the updated dependency.
# Make a commit with the updated dependency
git add -A
git commit -m "vendor: Update dependency upstream-pkg to 1.4.6"
# Push to your branch
git push origin my-feature-branch
govendor fetch github.com/hashicorp/my-project
```
2. Review the changes in git and commit them.
### Acceptance Tests
Terraform has a comprehensive [acceptance

View File

@ -1,92 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package emriface provides an interface for the Amazon Elastic MapReduce.
package emriface
import (
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/emr"
)
// EMRAPI is the interface type for emr.EMR.
type EMRAPI interface {
AddInstanceGroupsRequest(*emr.AddInstanceGroupsInput) (*request.Request, *emr.AddInstanceGroupsOutput)
AddInstanceGroups(*emr.AddInstanceGroupsInput) (*emr.AddInstanceGroupsOutput, error)
AddJobFlowStepsRequest(*emr.AddJobFlowStepsInput) (*request.Request, *emr.AddJobFlowStepsOutput)
AddJobFlowSteps(*emr.AddJobFlowStepsInput) (*emr.AddJobFlowStepsOutput, error)
AddTagsRequest(*emr.AddTagsInput) (*request.Request, *emr.AddTagsOutput)
AddTags(*emr.AddTagsInput) (*emr.AddTagsOutput, error)
DescribeClusterRequest(*emr.DescribeClusterInput) (*request.Request, *emr.DescribeClusterOutput)
DescribeCluster(*emr.DescribeClusterInput) (*emr.DescribeClusterOutput, error)
DescribeJobFlowsRequest(*emr.DescribeJobFlowsInput) (*request.Request, *emr.DescribeJobFlowsOutput)
DescribeJobFlows(*emr.DescribeJobFlowsInput) (*emr.DescribeJobFlowsOutput, error)
DescribeStepRequest(*emr.DescribeStepInput) (*request.Request, *emr.DescribeStepOutput)
DescribeStep(*emr.DescribeStepInput) (*emr.DescribeStepOutput, error)
ListBootstrapActionsRequest(*emr.ListBootstrapActionsInput) (*request.Request, *emr.ListBootstrapActionsOutput)
ListBootstrapActions(*emr.ListBootstrapActionsInput) (*emr.ListBootstrapActionsOutput, error)
ListBootstrapActionsPages(*emr.ListBootstrapActionsInput, func(*emr.ListBootstrapActionsOutput, bool) bool) error
ListClustersRequest(*emr.ListClustersInput) (*request.Request, *emr.ListClustersOutput)
ListClusters(*emr.ListClustersInput) (*emr.ListClustersOutput, error)
ListClustersPages(*emr.ListClustersInput, func(*emr.ListClustersOutput, bool) bool) error
ListInstanceGroupsRequest(*emr.ListInstanceGroupsInput) (*request.Request, *emr.ListInstanceGroupsOutput)
ListInstanceGroups(*emr.ListInstanceGroupsInput) (*emr.ListInstanceGroupsOutput, error)
ListInstanceGroupsPages(*emr.ListInstanceGroupsInput, func(*emr.ListInstanceGroupsOutput, bool) bool) error
ListInstancesRequest(*emr.ListInstancesInput) (*request.Request, *emr.ListInstancesOutput)
ListInstances(*emr.ListInstancesInput) (*emr.ListInstancesOutput, error)
ListInstancesPages(*emr.ListInstancesInput, func(*emr.ListInstancesOutput, bool) bool) error
ListStepsRequest(*emr.ListStepsInput) (*request.Request, *emr.ListStepsOutput)
ListSteps(*emr.ListStepsInput) (*emr.ListStepsOutput, error)
ListStepsPages(*emr.ListStepsInput, func(*emr.ListStepsOutput, bool) bool) error
ModifyInstanceGroupsRequest(*emr.ModifyInstanceGroupsInput) (*request.Request, *emr.ModifyInstanceGroupsOutput)
ModifyInstanceGroups(*emr.ModifyInstanceGroupsInput) (*emr.ModifyInstanceGroupsOutput, error)
RemoveTagsRequest(*emr.RemoveTagsInput) (*request.Request, *emr.RemoveTagsOutput)
RemoveTags(*emr.RemoveTagsInput) (*emr.RemoveTagsOutput, error)
RunJobFlowRequest(*emr.RunJobFlowInput) (*request.Request, *emr.RunJobFlowOutput)
RunJobFlow(*emr.RunJobFlowInput) (*emr.RunJobFlowOutput, error)
SetTerminationProtectionRequest(*emr.SetTerminationProtectionInput) (*request.Request, *emr.SetTerminationProtectionOutput)
SetTerminationProtection(*emr.SetTerminationProtectionInput) (*emr.SetTerminationProtectionOutput, error)
SetVisibleToAllUsersRequest(*emr.SetVisibleToAllUsersInput) (*request.Request, *emr.SetVisibleToAllUsersOutput)
SetVisibleToAllUsers(*emr.SetVisibleToAllUsersInput) (*emr.SetVisibleToAllUsersOutput, error)
TerminateJobFlowsRequest(*emr.TerminateJobFlowsInput) (*request.Request, *emr.TerminateJobFlowsOutput)
TerminateJobFlows(*emr.TerminateJobFlowsInput) (*emr.TerminateJobFlowsOutput, error)
}
var _ EMRAPI = (*emr.EMR)(nil)

View File

@ -1,20 +0,0 @@
language: go
sudo: false
install:
- go get golang.org/x/crypto/ssh
- go get -v -tags 'fixtures acceptance' ./...
go:
- 1.4
- 1.5
- tip
env:
- COVERALLS_TOKEN=2k7PTU3xa474Hymwgdj6XjqenNfGTNkO8
before_install:
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
- go get github.com/pierrre/gotestcover
- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
script:
- $HOME/gopath/bin/gotestcover -v -tags=fixtures -coverprofile=cover.out ./...
after_success:
- $HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=cover.out

View File

@ -25,6 +25,9 @@ type Monitor struct {
// The unique ID for the VIP.
ID string
// Monitor name. Does not have to be unique.
Name string
// Owner of the VIP. Only an administrative user can specify a tenant ID
// other than its own.
TenantID string `json:"tenant_id" mapstructure:"tenant_id"`

1604
vendor/vendor.json vendored Normal file

File diff suppressed because it is too large Load Diff