Skip to content

Commit

Permalink
libnetwork: remove consul-related code and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jan 6, 2022
1 parent 25594c3 commit 147173b
Show file tree
Hide file tree
Showing 24 changed files with 2 additions and 3,988 deletions.
2 changes: 1 addition & 1 deletion libnetwork/datastore/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ type ScopeClientCfg struct {
const (
// LocalScope indicates to store the KV object in local datastore such as boltdb
LocalScope = "local"
// GlobalScope indicates to store the KV object in global datastore such as consul/etcd
// GlobalScope indicates to store the KV object in global datastore such as etcd
GlobalScope = "global"
// SwarmScope is not indicating a datastore location. It is defined here
// along with the other two scopes just for consistency.
Expand Down
153 changes: 0 additions & 153 deletions libnetwork/docs/overlay.md

This file was deleted.

2 changes: 0 additions & 2 deletions libnetwork/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import (

"github.com/docker/docker/libnetwork/datastore"
"github.com/docker/libkv/store/boltdb"
"github.com/docker/libkv/store/consul"
"github.com/docker/libkv/store/etcd"
"github.com/sirupsen/logrus"
)

func registerKVStores() {
consul.Register()
etcd.Register()
boltdb.Register()
}
Expand Down
19 changes: 0 additions & 19 deletions libnetwork/test/integration/dnet/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,6 @@ function net_disconnect() {
dnet_cmd $(inst_id2port ${1}) service unpublish ${2}.${3}
}

function start_consul() {
stop_consul
docker run -d \
--name=pr_consul \
-p 8500:8500 \
-p 8300-8302:8300-8302/tcp \
-p 8300-8302:8300-8302/udp \
-h consul \
progrium/consul -server -bootstrap
sleep 2
}

function stop_consul() {
echo "consul started"
docker rm -f pr_consul || true
}

hrun() {
local e E T oldIFS
[[ ! "$-" =~ e ]] || e=1
Expand Down Expand Up @@ -151,8 +134,6 @@ function start_dnet() {
neighbors=""
if [ "$store" = "etcd" ]; then
read discovery provider address < <(parse_discovery_str etcd://${bridge_ip}:42000/custom_prefix)
elif [ "$store" = "consul" ]; then
read discovery provider address < <(parse_discovery_str consul://${bridge_ip}:8500/custom_prefix)
else
if [ "$nip" != "" ]; then
neighbors=${nip}
Expand Down
8 changes: 0 additions & 8 deletions libnetwork/test/integration/dnet/overlay-consul-host.bats

This file was deleted.

56 changes: 0 additions & 56 deletions libnetwork/test/integration/dnet/overlay-consul.bats

This file was deleted.

68 changes: 1 addition & 67 deletions libnetwork/test/integration/dnet/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,6 @@ function run_overlay_local_tests() {
unset cmap[dnet-3-local]
}

function run_overlay_consul_tests() {
## Test overlay network with consul
## Setup
start_dnet 1 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[dnet - 1 - consul]=dnet-1-consul
start_dnet 2 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[dnet - 2 - consul]=dnet-2-consul
start_dnet 3 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[dnet - 3 - consul]=dnet-3-consul

## Run the test cases
./integration-tmp/bin/bats ./test/integration/dnet/overlay-consul.bats

## Teardown
stop_dnet 1 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
unset cmap[dnet-1-consul]
stop_dnet 2 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
unset cmap[dnet-2-consul]
stop_dnet 3 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
unset cmap[dnet-3-consul]
}

function run_overlay_consul_host_tests() {
export _OVERLAY_HOST_MODE="true"
## Setup
start_dnet 1 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[dnet - 1 - consul]=dnet-1-consul

## Run the test cases
./integration-tmp/bin/bats ./test/integration/dnet/overlay-consul-host.bats

## Teardown
stop_dnet 1 consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
unset cmap[dnet-1-consul]
unset _OVERLAY_HOST_MODE
}

function run_overlay_etcd_tests() {
## Test overlay network with etcd
start_dnet 1 etcd 1>> ${INTEGRATION_ROOT}/test.log 2>&1
Expand All @@ -113,29 +76,6 @@ function run_dnet_tests() {
./integration-tmp/bin/bats ./test/integration/dnet/dnet.bats
}

function run_multi_consul_tests() {
# Test multi node configuration with a global scope test driver backed by consul

## Setup
start_dnet 1 multi_consul consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[dnet - 1 - multi_consul]=dnet-1-multi_consul
start_dnet 2 multi_consul consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[dnet - 2 - multi_consul]=dnet-2-multi_consul
start_dnet 3 multi_consul consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[dnet - 3 - multi_consul]=dnet-3-multi_consul

## Run the test cases
./integration-tmp/bin/bats ./test/integration/dnet/multi.bats

## Teardown
stop_dnet 1 multi_consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
unset cmap[dnet-1-multi_consul]
stop_dnet 2 multi_consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
unset cmap[dnet-2-multi_consul]
stop_dnet 3 multi_consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
unset cmap[dnet-3-multi_consul]
}

function run_multi_etcd_tests() {
# Test multi node configuration with a global scope test driver backed by etcd

Expand Down Expand Up @@ -178,17 +118,11 @@ fi
# Suite setup

if [ -z "$SUITES" ]; then
suites="dnet multi_consul multi_etcd bridge overlay_consul overlay_consul_host overlay_etcd"
suites="dnet multi_etcd bridge overlay_etcd"
else
suites="$SUITES"
fi

if [[ ("$suites" =~ .*consul.*) || ("$suites" =~ .*bridge.*) ]]; then
echo "Starting consul ..."
start_consul 1>> ${INTEGRATION_ROOT}/test.log 2>&1
cmap[pr_consul]=pr_consul
fi

if [[ "$suites" =~ .*etcd.* ]]; then
echo "Starting etcd ..."
start_etcd 1>> ${INTEGRATION_ROOT}/test.log 2>&1
Expand Down
1 change: 0 additions & 1 deletion vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ github.com/google/btree 479b5e81b0a93ec038d201b0b33d
github.com/deckarep/golang-set ef32fa3046d9f249d399f98ebaf9be944430fd1d
github.com/coreos/etcd 973882f697a8db3d59815bf132c6c506434334bd # v3.3.27
github.com/coreos/go-semver 8ab6407b697782a06568d4b7f1db25550ec2e4c6 # v0.2.0
github.com/hashicorp/consul 9a9cc9341bb487651a0399e3fc5e1e8a42e62dd9 # v0.5.2
github.com/miekg/dns 6c0c4e6581f8e173cc562c8b3363ab984e4ae071 # v1.1.27
github.com/ishidawataru/sctp f2269e66cdee387bd321445d5d300893449805be
go.etcd.io/bbolt 232d8fc87f50244f9c808f4745759e08a304c029 # v1.3.5
Expand Down
Loading

0 comments on commit 147173b

Please sign in to comment.