Closed bboreham closed 8 years ago
Steps to reproduce it:
vagrant@vagrant-ubuntu-wily-64:~/weave/test$ ./830_cni_plugin_test.sh
Test CNI plugin
[...]
net.ipv4.conf.all.arp_accept = 1
[...]
192.168.48.11> {
192.168.48.11> "ip4": {
192.168.48.11> "ip": "10.32.0.1/12",
192.168.48.11> "gateway": "10.32.0.2"
192.168.48.11> },
192.168.48.11> "dns": {}
[...]
192.168.48.11> {
192.168.48.11> "ip4": {
192.168.48.11> "ip": "10.32.0.3/12",
192.168.48.11> "routes": [
192.168.48.11> {
192.168.48.11> "dst": "10.32.0.0/12"
192.168.48.11> }
192.168.48.11> ]
192.168.48.11> },
192.168.48.11> "dns": {}
c2
827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
[...]
192.168.48.11> {
192.168.48.11> "ip4": {
192.168.48.11> "ip": "10.32.0.3/12",
192.168.48.11> "gateway": "10.32.0.2"
192.168.48.11> },
192.168.48.11> "dns": {}
all 3 tests passed in 27.898s.
vagrant@host1:~$ WEAVE_DEBUG=1 weave launch-router --log-level=debug
+ SCRIPT_VERSION=(unreleased version)
+ IMAGE_VERSION=latest
+ [ (unreleased version) = (unreleased version) ]
+ IMAGE_VERSION=latest
+ MIN_DOCKER_VERSION=1.6.0
+ DOCKERHUB_USER=weaveworks
+ BASE_EXEC_IMAGE=weaveworks/weaveexec
+ EXEC_IMAGE=weaveworks/weaveexec:latest
+ WEAVEDB_IMAGE=weaveworks/weavedb
+ cut -s -d: -f1
+ echo
+ PROXY_HOST=
+ PROXY_HOST=127.0.0.1
+ DOCKER_CLIENT_HOST=
+ IP_REGEXP=[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
+ CIDR_REGEXP=[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}
+ check_docker_version
+ sed -n -e s|^Docker version \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p
+ docker -v
+ DOCKER_VERSION=1.12.3
+ [ -z 1.12.3 ]
+ version_lt 1.12.3 1.6.0
+ VERSION_MAJOR=1
+ REST=1.12 VERSION_MINOR=12
+ VERSION_PATCH=3
+ MIN_VERSION_MAJOR=1
+ REST=1.6 MIN_VERSION_MINOR=6
+ MIN_VERSION_PATCH=0
+ [ ( 1 -lt 1 ) -o ( 1 -eq 1 -a ( 12 -lt 6 -o ( 12 -eq 6 -a ( 3 -lt 0 ) ) ) ) ]
+ return 1
+ [ launch-router = --local ]
+ handle_help_arg launch-router
+ [ launch-router = --help ]
+ [ launch-router = version -a -z ]
+ [ launch-router = env -a --log-level=debug = --restore ]
+ [ launch-router = run -a -z ]
+ [ -z ]
+ exec_remote launch-router --log-level=debug
+ docker_run_options
+ docker_sock_options
+ grep -q ^unix://
+ echo
+ echo -v /var/run/docker.sock:/var/run/docker.sock
+ echo --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock
+ exec_options launch-router --log-level=debug
+ echo -v /:/host -e HOST_ROOT=/host
+ docker run --rm --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock --pid=host -v /:/host -e HOST_ROOT=/host -e DOCKERHUB_USER=weaveworks -e WEAVE_VERSION -e WEAVE_DEBUG -e WEAVE_DOCKER_ARGS -e WEAVEPROXY_DOCKER_ARGS -e WEAVEPLUGIN_DOCKER_ARGS -e WEAVE_PASSWORD -e WEAVE_PORT -e WEAVE_HTTP_ADDR -e WEAVE_CONTAINER_NAME -e WEAVE_MTU -e WEAVE_NO_FASTDP -e WEAVE_NO_BRIDGED_FASTDP -e WEAVE_NO_PLUGIN -e DOCKER_BRIDGE -e DOCKER_CLIENT_HOST= -e DOCKER_CLIENT_ARGS -e PROXY_HOST=127.0.0.1 -e COVERAGE -e CHECKPOINT_DISABLE -e AWSVPC weaveworks/weaveexec:latest --local launch-router --log-level=debug
+ SCRIPT_VERSION=(unreleased version)
+ IMAGE_VERSION=latest
+ [ (unreleased version) = (unreleased version) ]
+ IMAGE_VERSION=latest
+ MIN_DOCKER_VERSION=1.6.0
+ DOCKERHUB_USER=weaveworks
+ BASE_EXEC_IMAGE=weaveworks/weaveexec
+ EXEC_IMAGE=weaveworks/weaveexec:latest
+ WEAVEDB_IMAGE=weaveworks/weavedb
+ PROXY_HOST=127.0.0.1
+ PROXY_HOST=127.0.0.1
+ DOCKER_CLIENT_HOST=
+ IP_REGEXP=[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
+ CIDR_REGEXP=[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}
+ check_docker_version
+ sed -n -e s|^Docker version \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p
+ docker -v
+ DOCKER_VERSION=1.6.2
+ [ -z 1.6.2 ]
+ version_lt 1.6.2 1.6.0
+ VERSION_MAJOR=1
+ REST=1.6 VERSION_MINOR=6
+ VERSION_PATCH=2
+ MIN_VERSION_MAJOR=1
+ REST=1.6 MIN_VERSION_MINOR=6
+ MIN_VERSION_PATCH=0
+ [ ( 1 -lt 1 ) -o ( 1 -eq 1 -a ( 6 -lt 6 -o ( 6 -eq 6 -a ( 2 -lt 0 ) ) ) ) ]
+ return 1
+ [ --local = --local ]
+ shift 1
+ IS_LOCAL=1
+ handle_help_arg launch-router
+ [ launch-router = --help ]
+ [ launch-router = version -a -z 1 ]
+ [ launch-router = env -a --log-level=debug = --restore ]
+ [ launch-router = run -a -z 1 ]
+ [ -z 1 ]
+ RESTART_POLICY=--restart=always
+ BASE_IMAGE=weaveworks/weave
+ IMAGE=weaveworks/weave:latest
+ CONTAINER_NAME=weave
+ BASE_PLUGIN_IMAGE=weaveworks/plugin
+ PLUGIN_IMAGE=weaveworks/plugin:latest
+ PLUGIN_CONTAINER_NAME=weaveplugin
+ VOLUMES_CONTAINER_NAME=weavevolumes-latest
+ DB_CONTAINER_NAME=weavedb
+ DOCKER_BRIDGE=docker0
+ BRIDGE=weave
+ DATAPATH=datapath
+ CONTAINER_IFNAME=ethwe
+ BRIDGE_IFNAME=vethwe-bridge
+ DATAPATH_IFNAME=vethwe-datapath
+ PCAP_IFNAME=vethwe-pcap
+ PORT=6783
+ HTTP_ADDR=127.0.0.1:6784
+ PROXY_PORT=12375
+ PROXY_CONTAINER_NAME=weaveproxy
+ COVERAGE_ARGS=
+ [ -n ]
+ id -u
+ [ 0 = 0 ]
+ read sys maj min
+ sed -n -e s|^\([^ ]*\) \([0-9][0-9]*\)\.\([0-9][0-9]*\).*|\1 \2 \3|p
+ uname -s -r
+ [ Linux != Linux ]
+ [ ( 4 -eq 3 -a 2 -ge 8 ) -o 4 -gt 3 ]
+ command_exists ip
+ command -v ip
+ ip netns list
+ command_exists nsenter
+ command -v nsenter
+ [ 2 -gt 0 ]
+ COMMAND=launch-router
+ shift 1
+ handle_help_arg --log-level=debug
+ [ --log-level=debug = --help ]
+ deprecation_warnings --log-level=debug
+ [ 1 -gt 0 ]
+ shift
+ [ 0 -gt 0 ]
+ check_not_running router weave weaveworks/weave
+ docker inspect --format={{.State.Running}} {{.State.Status}} {{.Config.Image}} weave
+ RUN_STATUS=false exited weaveworks/weave:latest
+ docker rm weave
+ launch_router --log-level=debug
+ LAUNCHING_ROUTER=1
+ check_forwarding_rules
+ run_iptables -C FORWARD -j REJECT --reject-with icmp-host-prohibited
+ enforce_docker_bridge_addr_assign_type
+ cat /sys/class/net/docker0/addr_assign_type
+ ADDR_ASSIGN_TYPE=3
+ [ 3 != 3 ]
+ is_cidr --log-level=debug
+ grep -E ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}$
+ echo --log-level=debug
+ CONTAINER_PORT=6783
+ ARGS=
+ IPRANGE=
+ IPRANGE_SPECIFIED=
+ docker_bridge_ip
+ grep -m1 -o inet [.0-9]*
+ ip -4 addr show dev docker0
+ DOCKER_BRIDGE_IP=inet 172.17.0.1
+ DOCKER_BRIDGE_IP=172.17.0.1
+ DNS_ROUTER_OPTS=--dns-listen-address 172.17.0.1:53
+ NO_DNS_OPT=
+ [ 1 -gt 0 ]
+ sed s|'|'"'"'|g
+ echo --log-level=debug
+ ARGS= '--log-level=debug'
+ shift
+ [ 0 -gt 0 ]
+ eval set -- '--log-level=debug'
+ set -- --log-level=debug
+ setup_cni
+ [ -d /host/opt/cni/bin ]
+ create_cni_script /host/opt/cni/bin/weave-net --cni-net
+ cat
+ docker_run_options
+ docker_sock_options
+ grep -q ^unix://
+ echo
+ echo -v /var/run/docker.sock:/var/run/docker.sock
+ echo --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock
+ chmod a+x /host/opt/cni/bin/weave-net
+ create_cni_script /host/opt/cni/bin/weave-ipam --cni-ipam
+ cat
+ docker_run_options
+ docker_sock_options
+ grep -q ^unix://
+ echo
+ echo -v /var/run/docker.sock:/var/run/docker.sock
+ echo --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock
+ chmod a+x /host/opt/cni/bin/weave-ipam
+ [ -d /host/etc/cni/net.d -a ! -f /host/etc/cni/net.d/10-weave.conf ]
+ create_bridge
+ detect_bridge_type
+ BRIDGE_TYPE=
+ [ -d /sys/class/net/datapath ]
+ [ ! -d /sys/class/net/datapath/bridge -a -d /sys/class/net/weave/bridge ]
+ BRIDGE_TYPE=bridged_fastdp
+ cat /sys/class/net/weave/mtu
+ MTU=1410
+ [ -n 1 ]
+ [ bridged_fastdp = bridge -a -z ]
+ [ bridged_fastdp != bridge -a -n ]
+ [ = --without-ethtool -o -n ]
+ ethtool_tx_off_bridged_fastdp weave
+ true
+ ip link set dev weave up
+ configure_arp_cache weave
+ sh -c echo 5 >/proc/sys/net/ipv4/neigh/weave/base_reachable_time &&
echo 2 >/proc/sys/net/ipv4/neigh/weave/delay_first_probe_time &&
echo 1 >/proc/sys/net/ipv4/neigh/weave/ucast_solicit
+ cat /sys/class/net/weave/address
+ PEERNAME=be:fe:c6:af:58:f7
+ [ -z ]
+ IPRANGE=10.32.0.0/12
+ check_overlap 10.32.0.0/12
+ util_op netcheck 10.32.0.0/12 weave
+ command_exists weaveutil
+ command -v weaveutil
+ weaveutil netcheck 10.32.0.0/12 weave
+ docker inspect -f weavedb
+ chroot /host readlink -f /etc/resolv.conf
+ RESOLV_CONF=/run/resolvconf/resolv.conf
+ dirname /run/resolvconf/resolv.conf
+ RESOLV_CONF_DIR=/run/resolvconf
+ basename /run/resolvconf/resolv.conf
+ RESOLV_CONF_BASE=resolv.conf
+ docker_run_options
+ docker_sock_options
+ grep -q ^unix://
+ echo
+ echo -v /var/run/docker.sock:/var/run/docker.sock
+ echo --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock
+ hostname
+ router_opts_bridged_fastdp
+ router_opts_fastdp
+ echo --datapath datapath
+ docker run -d --name=weave --privileged --net=host -v /var/run/docker.sock:/var/run/docker.sock --restart=always --volumes-from weavedb -v /run/resolvconf:/var/run/weave/etc -e WEAVE_PASSWORD -e CHECKPOINT_DISABLE weaveworks/weave:latest --port 6783 --name be:fe:c6:af:58:f7 --nickname host1 --datapath datapath --ipalloc-range 10.32.0.0/12 --dns-effective-listen-address 172.17.0.1 --dns-listen-address 172.17.0.1:53 --http-addr 127.0.0.1:6784 --resolv-conf /var/run/weave/etc/resolv.conf --log-level=debug
+ ROUTER_CONTAINER=f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759
+ wait_for_status weave http_call 127.0.0.1:6784
+ container=weave
+ shift
+ true
+ http_call 127.0.0.1:6784 GET /status
+ check_running weave
+ fractional_sleep 0.1
+ [ -z ]
+ sleep 0.1
+ return 0
+ true
+ http_call 127.0.0.1:6784 GET /status
+ check_running weave
+ fractional_sleep 0.1
+ [ -z ]
+ sleep 0.1
+ return 0
+ true
+ http_call 127.0.0.1:6784 GET /status
+ check_running weave
+ fractional_sleep 0.1
+ [ -z ]
+ sleep 0.1
+ return 0
+ true
+ http_call 127.0.0.1:6784 GET /status
+ return 0
+ setup_awsvpc
+ [ -n ]
+ populate_router
+ [ -n 10.32.0.0/12 ]
+ [ -n ]
+ with_container_addresses ipam_reclaim_no_check_alive weave:expose
+ COMMAND=ipam_reclaim_no_check_alive
+ shift 1
+ util_op container-addrs weave weave:expose
+ command_exists weaveutil
+ command -v weaveutil
+ weaveutil container-addrs weave weave:expose
+ CONTAINER_ADDRS=weave:expose weave be:fe:c6:af:58:f7 10.32.0.2/12
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ echo weave:expose weave be:fe:c6:af:58:f7 10.32.0.2/12
+ ipam_reclaim_no_check_alive weave:expose weave be:fe:c6:af:58:f7 10.32.0.2/12
+ http_call 127.0.0.1:6784 PUT /ip/weave:expose/10.32.0.2/12?noErrorOnUnknown=true
+ addr=127.0.0.1:6784
+ http_verb=PUT
+ url=/ip/weave:expose/10.32.0.2/12?noErrorOnUnknown=true
+ shift 3
+ CURL_TMPOUT=/tmp/weave_curl_out_11244
+ curl -o /tmp/weave_curl_out_11244 -w %{http_code} --connect-timeout 3 -s -S -X PUT http://127.0.0.1:6784/ip/weave:expose/10.32.0.2/12?noErrorOnUnknown=true
+ HTTP_CODE=204
+ [ -f /tmp/weave_curl_out_11244 ]
+ cat /tmp/weave_curl_out_11244
+ retval=0
+ rm -f /tmp/weave_curl_out_11244
+ return 0
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ docker ps -q --no-trunc
+ with_container_addresses ipam_reclaim f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759 4c0cc5451b39c3667e8b1b6f8e84fa618713dc4f9e08a70a6defdc2ae95c114c 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ COMMAND=ipam_reclaim
+ shift 1
+ util_op container-addrs weave f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759 4c0cc5451b39c3667e8b1b6f8e84fa618713dc4f9e08a70a6defdc2ae95c114c 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ command_exists weaveutil
+ command -v weaveutil
+ weaveutil container-addrs weave f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759 4c0cc5451b39c3667e8b1b6f8e84fa618713dc4f9e08a70a6defdc2ae95c114c 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ CONTAINER_ADDRS=827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 eth0 86:1f:80:b9:fd:27 10.32.0.3/12
4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214 eth0 3a:bd:7c:17:82:a0 10.32.0.1/12
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ echo 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 eth0 86:1f:80:b9:fd:27 10.32.0.3/12
4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214 eth0 3a:bd:7c:17:82:a0 10.32.0.1/12
+ ipam_reclaim 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 eth0 86:1f:80:b9:fd:27 10.32.0.3/12
+ CONTAINER_ID=827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
+ [ eth0 = ethwe ]
+ CONTAINER_ID=_
+ http_call 127.0.0.1:6784 PUT /ip/_/10.32.0.3/12?noErrorOnUnknown=true&?check-alive=true
+ addr=127.0.0.1:6784
+ http_verb=PUT
+ url=/ip/_/10.32.0.3/12?noErrorOnUnknown=true&?check-alive=true
+ shift 3
+ CURL_TMPOUT=/tmp/weave_curl_out_11244
+ curl -o /tmp/weave_curl_out_11244 -w %{http_code} --connect-timeout 3 -s -S -X PUT http://127.0.0.1:6784/ip/_/10.32.0.3/12?noErrorOnUnknown=true&?check-alive=true
+ HTTP_CODE=400
+ [ -f /tmp/weave_curl_out_11244 ]
+ cat /tmp/weave_curl_out_11244
Unable to claim: address 10.32.0.3/12 is already owned by 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
+ retval=1
+ rm -f /tmp/weave_curl_out_11244
+ return 1
+ true
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ ipam_reclaim 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214 eth0 3a:bd:7c:17:82:a0 10.32.0.1/12
+ CONTAINER_ID=4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ [ eth0 = ethwe ]
+ CONTAINER_ID=_
+ http_call 127.0.0.1:6784 PUT /ip/_/10.32.0.1/12?noErrorOnUnknown=true&?check-alive=true
+ addr=127.0.0.1:6784
+ http_verb=PUT
+ url=/ip/_/10.32.0.1/12?noErrorOnUnknown=true&?check-alive=true
+ shift 3
+ CURL_TMPOUT=/tmp/weave_curl_out_11244
+ curl -o /tmp/weave_curl_out_11244 -w %{http_code} --connect-timeout 3 -s -S -X PUT http://127.0.0.1:6784/ip/_/10.32.0.1/12?noErrorOnUnknown=true&?check-alive=true
+ HTTP_CODE=400
+ [ -f /tmp/weave_curl_out_11244 ]
+ cat /tmp/weave_curl_out_11244
Unable to claim: address 10.32.0.1/12 is already owned by 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ retval=1
+ rm -f /tmp/weave_curl_out_11244
+ return 1
+ true
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ [ -z ]
+ docker ps -q --no-trunc
+ with_container_addresses echo_ips f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759
+ COMMAND=echo_ips
+ shift 1
+ util_op container-addrs weave f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759
+ command_exists weaveutil
+ command -v weaveutil
+ weaveutil container-addrs weave f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759
+ CONTAINER_ADDRS=
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ echo
+ echo_ips
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ CONTAINER_IPS=
+ [ -n ]
+ with_container_addresses echo_ips 4c0cc5451b39c3667e8b1b6f8e84fa618713dc4f9e08a70a6defdc2ae95c114c
+ COMMAND=echo_ips
+ shift 1
+ util_op container-addrs weave 4c0cc5451b39c3667e8b1b6f8e84fa618713dc4f9e08a70a6defdc2ae95c114c
+ command_exists weaveutil
+ command -v weaveutil
+ weaveutil container-addrs weave 4c0cc5451b39c3667e8b1b6f8e84fa618713dc4f9e08a70a6defdc2ae95c114c
+ CONTAINER_ADDRS=
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ echo
+ echo_ips
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ CONTAINER_IPS=
+ [ -n ]
+ with_container_addresses echo_ips 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
+ COMMAND=echo_ips
+ shift 1
+ util_op container-addrs weave 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
+ command_exists weaveutil
+ command -v weaveutil
+ weaveutil container-addrs weave 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
+ CONTAINER_ADDRS=827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 eth0 86:1f:80:b9:fd:27 10.32.0.3/12
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ echo 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 eth0 86:1f:80:b9:fd:27 10.32.0.3/12
+ echo_ips 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 eth0 86:1f:80:b9:fd:27 10.32.0.3/12
+ echo 10.32.0.3
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ CONTAINER_IPS=10.32.0.3
+ [ -n 10.32.0.3 ]
+ with_container_fqdn 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461 put_dns_fqdn 10.32.0.3
+ CONT=827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
+ COMMAND=put_dns_fqdn
+ shift 2
+ docker inspect --format={{.Config.Hostname}}.{{.Config.Domainname}} 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
+ CONT_FQDN=827181e0d65a.
+ CONT_NAME=827181e0d65a
+ [ 827181e0d65a = 827181e0d65a. -o 827181e0d65a. = 827181e0d65a. ]
+ with_container_addresses echo_ips 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ COMMAND=echo_ips
+ shift 1
+ util_op container-addrs weave 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ command_exists weaveutil
+ command -v weaveutil
+ weaveutil container-addrs weave 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ CONTAINER_ADDRS=4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214 eth0 3a:bd:7c:17:82:a0 10.32.0.1/12
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ echo 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214 eth0 3a:bd:7c:17:82:a0 10.32.0.1/12
+ echo_ips 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214 eth0 3a:bd:7c:17:82:a0 10.32.0.1/12
+ echo 10.32.0.1
+ read CONTAINER_ID CONTAINER_IFACE CONTAINER_MAC CONTAINER_IPS
+ CONTAINER_IPS=10.32.0.1
+ [ -n 10.32.0.1 ]
+ with_container_fqdn 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214 put_dns_fqdn 10.32.0.1
+ CONT=4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ COMMAND=put_dns_fqdn
+ shift 2
+ docker inspect --format={{.Config.Hostname}}.{{.Config.Domainname}} 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
+ CONT_FQDN=4d15e29179fe.
+ CONT_NAME=4d15e29179fe
+ [ 4d15e29179fe = 4d15e29179fe. -o 4d15e29179fe. = 4d15e29179fe. ]
+ echo f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759
f9feb82a71409b27171efe213b1a08441490ab153f7ed241615c842fbfa75759
+ exit 0
vagrant@host1:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9feb82a7140 weaveworks/weave:latest "/home/weave/weaver -" 44 seconds ago Up 44 seconds weave
827181e0d65a alpine "/bin/sh" 6 minutes ago Up 6 minutes c3
4d15e29179fe alpine "/bin/sh" 6 minutes ago Up 6 minutes c1
and
vagrant@host1:~$ docker logs weave
INFO: 2016/10/31 11:53:55.714511 Command line options: map[datapath:datapath dns-effective-listen-address:172.17.0.1 log-level:debug resolv-conf:/var/run/weave/etc/resolv.conf dns-listen-address:172.17.0.1:53 http-addr:127.0.0.1:6784 ipalloc-range:10.32.0.0/12 name:be:fe:c6:af:58:f7 nickname:host1 port:6783]
INFO: 2016/10/31 11:53:55.715582 Communication between peers is unencrypted.
INFO: 2016/10/31 11:53:55.716028 Our name is be:fe:c6:af:58:f7(host1)
INFO: 2016/10/31 11:53:55.716100 Launch detected - using supplied peer list: []
INFO: 2016/10/31 11:53:55.718136 Docker API on unix:///var/run/docker.sock: &[BuildTime=2016-10-26T21:53:11.561981527+00:00 Version=1.12.3 ApiVersion=1.24 GitCommit=6b644ec GoVersion=go1.6.3 Os=linux Arch=amd64 KernelVersion=4.2.0-42-generic]
INFO: 2016/10/31 11:53:55.720940 [allocator be:fe:c6:af:58:f7] Initialising with persisted data
INFO: 2016/10/31 11:53:55.755863 Listening for DNS queries on 172.17.0.1
INFO: 2016/10/31 11:53:55.756013 Sniffing traffic on datapath (via ODP)
INFO: 2016/10/31 11:53:55.787769 Listening for HTTP control messages on 127.0.0.1:6784
DEBU: 2016/10/31 11:53:55.895224 [http] GET /status
DEBU: 2016/10/31 11:53:55.921226 [http] PUT /ip/weave:expose/10.32.0.2/12?noErrorOnUnknown=true
DEBU: 2016/10/31 11:53:55.922039 [allocator be:fe:c6:af:58:f7]: Re-Claimed 10.32.0.2/12 for weave:expose
DEBU: 2016/10/31 11:53:56.004488 [http] PUT /ip/_/10.32.0.3/12?noErrorOnUnknown=true&?check-alive=true
WARN: 2016/10/31 11:53:56.004690 [allocator]: Unable to claim: address 10.32.0.3/12 is already owned by 827181e0d65aa703b9a4d7656554483e36d097448ddb2d0897cc9dc8c85bf461
DEBU: 2016/10/31 11:53:56.017226 [http] PUT /ip/_/10.32.0.1/12?noErrorOnUnknown=true&?check-alive=true
WARN: 2016/10/31 11:53:56.017771 [allocator]: Unable to claim: address 10.32.0.1/12 is already owned by 4d15e29179fe4723ae09bab04281f00115498a75b4e55f24b12aa4aad309e214
INFO: 2016/10/31 11:54:15.877642 Error checking version: Get https://checkpoint-api.weave.works/v1/check/weave-net?arch=amd64&flag_docker-version=1.12.3&flag_kernel-version=4.2.0-42-generic&os=linux&signature=B4Xibpkuyfogiysst3TkYXMULmLNMRRvA3LtXFT3zNY%3D&version=git-00e754ed9f06: dial tcp: lookup checkpoint-api.weave.works on 192.168.1.1:53: read udp 10.0.2.15:51964->192.168.1.1:53: i/o timeout
and
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:6784 0.0.0.0:* LISTEN 7118/weaver
and
vagrant@host1:~$ curl -X GET "http://127.0.0.1:6784/status"
Version: git-00e754ed9f06 (failed to check latest version - see logs; next check at 2016/10/31 18:23:47)
Service: router
Protocol: weave 1..2
Name: be:fe:c6:af:58:f7(host1)
Encryption: disabled
PeerDiscovery: enabled
Targets: 0
Connections: 0
Peers: 1
TrustedSubnets: none
Service: ipam
Status: ready
Range: 10.32.0.0/12
DefaultSubnet: 10.32.0.0/12
Service: dns
Domain: weave.local.
Upstream: 192.168.1.1
TTL: 1
Entries: 0
Relevant calls:
weave/prog/weave/main.go
`- weave/ipam/http.go # HandleHTTP
`- weave/ipam/http.go # handleHTTPClaim
`- weave/ipam/allocator.go # Claim
`- weave/ipam/allocator.go # doOperation
`- weave/ipam/claim.go # Try
Relevant documentation: https://github.com/weaveworks/weave/blob/master/docs/ipam.md
Exhibit A:
From WEAVE_DEBUG log:
so the code sees the interface is
eth0
and from there assumes that IPAM would not know the container ID - this is the case when we use the Weave Plugin. But it does know the ID, because this one was set up via CNI.This behaviour was introduced by #2262
Maybe we can interpret
"_"
as "I don't care what ID it is under" ?