Skip to content

Commit

Permalink
Merge tag 'v1.0.0' into instart/master
Browse files Browse the repository at this point in the history
Version 1.0.0

* tag 'v1.0.0': (455 commits)
  Release v1.0.0
  Puts the tree in 1.0 final release mode.
  Fixes an XSS issue with unescaped node names. (hashicorp#3578)
  Adds a note about the Raft protocol not being the same as the Consul protocol.
  Adds a 1.0 section to the upgrade guide and cleans up the change log.
  Update sentinel.html.markdown.erb
  Update dns forwarding documentation (hashicorp#3574)
  Adds a brief wait and poll period to update check status after a timeout. (hashicorp#3573)
  Cleans up some drift between the OSS and Enterprise trees.
  Clarify the docs around script check timeout behavior
  Updates the change log.
  Kill check processes after the timeout is reached (hashicorp#3567)
  Updates the change log.
  retry locks on network errors (hashicorp#3553)
  Fix example code formatting in godoc
  config: remove redundant code
  config: fix check for segment.port <= 0 and add test
  Adds check to make sure port is given so we avoid a nil bind address.
  Removes obsolete segment stub.
  agent: add option to discard health output (hashicorp#3562)
  ...
  • Loading branch information
Michael Weber committed Nov 9, 2017
2 parents 0be4c89 + 51ea240 commit 02c6472
Show file tree
Hide file tree
Showing 982 changed files with 123,771 additions and 13,573 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/pkg
Thumbs.db
bin/
consul
changelog.tmp
exit-code
ui/.bundle
ui/.sass-cache
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- 1.8.3
- 1.x

branches:
only:
Expand Down
1,138 changes: 683 additions & 455 deletions CHANGELOG.md

Large diffs are not rendered by default.

34 changes: 26 additions & 8 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GOTOOLS = \
github.com/axw/gocov/gocov \
gopkg.in/matm/v1/gocov-html

GOTAGS ?= consul
GOTAGS ?=
GOFILES ?= $(shell go list ./... | grep -v /vendor/)
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
Expand All @@ -31,18 +31,24 @@ bin: tools
@GOTAGS='$(GOTAGS)' sh -c "'$(CURDIR)/scripts/build.sh'"

# dev creates binaries for testing locally - these are put into ./bin and $GOPATH
dev: vendorfmt dev-build
dev: changelogfmt vendorfmt dev-build

dev-build:
@echo "--> Building consul"
mkdir -p pkg/$(GOOS)_$(GOARCH)/ bin/
go install -ldflags '$(GOLDFLAGS)' -tags '$(GOTAGS)'
cp $(GOPATH)/bin/consul bin/
cp $(GOPATH)/bin/consul pkg/$(GOOS)_$(GOARCH)

vendorfmt:
@echo "--> Formatting vendor/vendor.json"
test -x $(GOPATH)/bin/vendorfmt || go get -u github.com/magiconair/vendorfmt/cmd/vendorfmt
vendorfmt

changelogfmt:
@echo "--> Making [GH-xxxx] references clickable..."
@sed -E 's|([^\[])\[GH-([0-9]+)\]|\1[[GH-\2](https://github.com/hashicorp/consul/issues/\2)]|g' CHANGELOG.md > changelog.tmp && mv changelog.tmp CHANGELOG.md

# linux builds a linux package independent of the source platform
linux:
mkdir -p pkg/linux_amd64/
Expand All @@ -56,22 +62,34 @@ cov:
gocov test $(GOFILES) | gocov-html > /tmp/coverage.html
open /tmp/coverage.html

test: dev-build vet
test: other-consul porter dev-build vet
@echo "--> Running go test"
@rm -f test.log exit-code
go test -tags '$(GOTAGS)' -i ./...
go test $(GOTEST_FLAGS) -tags '$(GOTAGS)' -timeout 7m -v ./... 2>&1 >test$(GOTEST_FLAGS).log ; echo $$? > exit-code
@echo "Exit code: `cat exit-code`" >> test$(GOTEST_FLAGS).log
@echo "----"
porter go test $(GOTEST_FLAGS) -tags '$(GOTAGS)' -timeout 5m -v ./... &>test.log ; echo $$? > exit-code
@echo "Exit code: $$(cat exit-code)" >> test.log
@grep -A5 'DATA RACE' test.log || true
@grep -A10 'panic: test timed out' test.log || true
@grep '^PASS' test.log | uniq || true
@grep -A1 -- '--- SKIP:' test.log || true
@grep -A1 -- '--- FAIL:' test.log || true
@grep '^FAIL' test.log || true
@test "$$TRAVIS" == "true" && cat test.log || true
@exit $$(cat exit-code)
@if [ "$$(cat exit-code)" == "0" ] ; then echo "PASS" ; exit 0 ; else exit 1 ; fi

test-race:
$(MAKE) GOTEST_FLAGS=-race

other-consul:
@echo "--> Checking for other consul instances"
@if ps -ef | grep 'consul agent' | grep -v grep ; then \
echo "Found other running consul agents. This may affect your tests." ; \
exit 1 ; \
fi

porter:
@echo "--> Building port number service..."
go install github.com/hashicorp/consul/test/porter/cmd/porter

cover:
go test $(GOFILES) --cover

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ https://www.consul.io/docs
## Developing Consul

If you wish to work on Consul itself, you'll first need [Go](https://golang.org)
installed (version 1.8+ is _required_). Make sure you have Go properly installed,
installed (version 1.9+ is _required_). Make sure you have Go properly installed,
including setting up your [GOPATH](https://golang.org/doc/code.html#GOPATH).

Next, clone this repository into `$GOPATH/src/github.com/hashicorp/consul` and
Expand Down
66 changes: 66 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
#

LINUX_BASE_BOX = "bento/ubuntu-16.04"

Vagrant.configure(2) do |config|
config.vm.define "linux", autostart: true, primary: true do |vmCfg|
vmCfg.vm.box = LINUX_BASE_BOX
vmCfg.vm.hostname = "linux"
vmCfg = configureProviders vmCfg,
cpus: suggestedCPUCores()

vmCfg = configureLinuxProvisioners(vmCfg)

vmCfg.vm.synced_folder '.',
'/opt/gopath/src/github.com/hashicorp/consul'

vmCfg.vm.network "forwarded_port", guest: 8500, host: 8500, auto_correct: true
end
end

def configureLinuxProvisioners(vmCfg)
vmCfg.vm.provision "shell",
privileged: true,
inline: 'rm -f /home/vagrant/linux.iso'

vmCfg.vm.provision "shell",
privileged: true,
path: './scripts/vagrant-linux-priv-go.sh'

return vmCfg
end

def configureProviders(vmCfg, cpus: "2", memory: "2048")
vmCfg.vm.provider "virtualbox" do |v|
v.memory = memory
v.cpus = cpus
end

["vmware_fusion", "vmware_workstation"].each do |p|
vmCfg.vm.provider p do |v|
v.enable_vmrun_ip_lookup = false
v.vmx["memsize"] = memory
v.vmx["numvcpus"] = cpus
end
end

vmCfg.vm.provider "virtualbox" do |v|
v.memory = memory
v.cpus = cpus
end

return vmCfg
end

def suggestedCPUCores()
case RbConfig::CONFIG['host_os']
when /darwin/
Integer(`sysctl -n hw.ncpu`) / 2
when /linux/
Integer(`cat /proc/cpuinfo | grep processor | wc -l`) / 2
else
2
end
end

0 comments on commit 02c6472

Please sign in to comment.