From a0cc117b70549700691ce63218995456b6c388ac Mon Sep 17 00:00:00 2001 From: Tom Denham Date: Wed, 11 Jan 2017 16:15:49 -0800 Subject: [PATCH 01/18] Makefile: Run test-containerized as root --- Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 14e8aa1..73af5a2 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,8 @@ CALICO_BUILD?=calico/go-build PLUGIN_LOCATION?=$(CURDIR)/dist/libnetwork-plugin DOCKER_BINARY_CONTAINER?=docker-binary-container -# To run with non-native docker (e.g. on Windows or OSX) you might need to overide these variables +# To run with non-native docker (e.g. on Windows or OSX) you might need to overide this variable LOCAL_USER_ID?=$(shell id -u $$USER) -LOCAL_GROUP_ID?=$(shell getent group docker | cut -d: -f3) default: all all: test @@ -137,11 +136,9 @@ test-containerized: dist/libnetwork-plugin docker run -ti --rm --net=host \ -v $(CURDIR):/go/src/github.com/projectcalico/libnetwork-plugin \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v $(CURDIR)/.go-pkg-cache:/go/pkg/:rw \ -v $(CURDIR)/docker:/usr/bin/docker \ -e PLUGIN_LOCATION=$(CURDIR)/dist/libnetwork-plugin \ - -e EXTRA_GROUP_ID=$(LOCAL_GROUP_ID) \ - -e LOCAL_USER_ID=$(LOCAL_USER_ID) \ + -e LOCAL_USER_ID=0 \ calico/go-build sh -c '\ cd /go/src/github.com/projectcalico/libnetwork-plugin && \ make test' From b5be8b6644711d9a15738cdb13db20a973915b5f Mon Sep 17 00:00:00 2001 From: JW Bell Date: Thu, 5 Jan 2017 14:41:39 -0800 Subject: [PATCH 02/18] Reject unknown options Remove special casing of --internal and --opt and reject all other options also. --- driver/network_driver.go | 60 ++++++++++++++------ tests/default_environment/libnetwork_test.go | 9 ++- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/driver/network_driver.go b/driver/network_driver.go index c3b7abc..eb3554f 100644 --- a/driver/network_driver.go +++ b/driver/network_driver.go @@ -2,6 +2,7 @@ package driver import ( "context" + "fmt" "net" "os" "strings" @@ -89,24 +90,49 @@ func (d NetworkDriver) GetCapabilities() (*network.CapabilitiesResponse, error) func (d NetworkDriver) CreateNetwork(request *network.CreateNetworkRequest) error { logutils.JSONMessage("CreateNetwork", request) - genericOpts, ok := request.Options["com.docker.network.generic"] - if ok { - opts, ok := genericOpts.(map[string]interface{}) - if ok && len(opts) != 0 { - err := errors.New("Arbitrary options are not supported") - log.Println(err) + // Reject all options (--internal, --enable_ipv6, etc) + for k, v := range request.Options { + optionSet := false + flagName := k + flagValue := fmt.Sprintf("%s", v) + multipleFlags := false + switch v := v.(type) { + case bool: + // if v == true then optionSet = true + optionSet = v + flagName = "--" + strings.TrimPrefix(k, "com.docker.network.") + flagValue = "" + break + case map[string]interface{}: + optionSet = len(v) != 0 + flagName = "" + numFlags := 0 + for mk, _ := range v { + flagName = flagName + "" + mk + ", " + numFlags++ + } + multipleFlags = numFlags > 1 + flagName = strings.TrimSuffix(flagName, ", ") + flagValue = "" + break + default: + // for unknown case let optionSet = true + optionSet = true + } + if optionSet { + if flagValue != "" { + flagValue = " (" + flagValue + ")" + } + f := "flag" + if multipleFlags { + f = "flags" + } + err := errors.New("Calico driver does not support the " + f + " " + flagName + flagValue + ".") + log.Errorln(err) return err } } - // Calico driver does not allow you use the --internal flag - internal, ok := request.Options["com.docker.network.internal"].(bool) - if ok && internal { - err := errors.New("Calico driver does not support the --internal flag.") - log.Errorln(err) - return err - } - for _, ipData := range request.IPv4Data { // Older version of Docker have a bug where they don't provide the correct AddressSpace // so we can't check for calico IPAM using our known address space. @@ -230,9 +256,9 @@ func (d NetworkDriver) CreateEndpoint(request *network.CreateEndpointRequest) (* log.Debugf("Workload created, data: %+v\n", endpoint) - if d.labelEndpoints { - go d.populateWorkloadEndpointWithLabels(request.NetworkID, endpoint) - } + if d.labelEndpoints { + go d.populateWorkloadEndpointWithLabels(request.NetworkID, endpoint) + } var endpointInterface network.EndpointInterface if !userProvidedMac { diff --git a/tests/default_environment/libnetwork_test.go b/tests/default_environment/libnetwork_test.go index f4f244e..756f196 100644 --- a/tests/default_environment/libnetwork_test.go +++ b/tests/default_environment/libnetwork_test.go @@ -48,7 +48,7 @@ var _ = Describe("Libnetwork Tests", func() { It("rejects --internal being used", func() { session := DockerSession("docker network create $RANDOM --internal -d calico --ipam-driver calico-ipam") Eventually(session).Should(Exit(1)) - Eventually(session.Err).Should(Say("Error response from daemon: NetworkDriver.CreateNetwork: Calico driver does not support the --internal flag.")) + Eventually(session.Err).Should(Say("Error response from daemon: NetworkDriver.CreateNetwork: Calico driver does not support the flag --internal.")) }) It("rejects --ip-range being used", func() { session := DockerSession("docker network create $RANDOM --ip-range 192.169.1.0/24 --subnet=192.169.0.0/16 -d calico --ipam-driver calico-ipam") @@ -63,7 +63,12 @@ var _ = Describe("Libnetwork Tests", func() { It("rejects --opt being used", func() { session := DockerSession("docker network create $RANDOM --opt REJECT -d calico --ipam-driver calico-ipam") Eventually(session).Should(Exit(1)) - Eventually(session.Err).Should(Say("Error response from daemon: NetworkDriver.CreateNetwork: Arbitrary options are not supported")) + Eventually(session.Err).Should(Say("NetworkDriver.CreateNetwork: Calico driver does not support the flag REJECT.")) + }) + It("rejects multiple --opt being used", func() { + session := DockerSession("docker network create $RANDOM --opt REJECT --opt REJECT2 -d calico --ipam-driver calico-ipam") + Eventually(session).Should(Exit(1)) + Eventually(session.Err).Should(Say("NetworkDriver.CreateNetwork: Calico driver does not support the flags REJECT, REJECT2.")) }) }) Context("checking success cases", func() { From 17315085e8b586273871b47eb1f712288caa7b74 Mon Sep 17 00:00:00 2001 From: Tom Denham Date: Wed, 18 Jan 2017 16:21:38 -0800 Subject: [PATCH 03/18] Makefile: Use docker v1.13 in the tests ..now that the final version of 1.13 has shipped we can stop using an RC --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 14e8aa1..66e2d77 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SRC_FILES=$(shell find . -type f -name '*.go') LOCAL_IP_ENV?=$(shell ip route get 8.8.8.8 | head -1 | awk '{print $$7}') # Can choose different docker versions see list here - https://hub.docker.com/_/docker/ -DOCKER_VERSION?=rc-dind +DOCKER_VERSION?=dind HOST_CHECKOUT_DIR?=$(CURDIR) CONTAINER_NAME?=calico/libnetwork-plugin CALICO_BUILD?=calico/go-build From 1ba7b6c81f1edeabfe5ac3a4d4d730b7bd368251 Mon Sep 17 00:00:00 2001 From: JW Bell Date: Thu, 19 Jan 2017 11:56:32 -0800 Subject: [PATCH 04/18] Add stubbed Allocate/FreeNetwork api methods Allocate/FreeNetwork are used for swarm-mode support in remote plugins, which calico doesn't support. Stubbed versions of both are added. - Update github.com/docker/go-connections dependency, including update of calls to ServeUnix in main.go:main(). ServeUnix removed group name support lookup. - Update and remove pinning of github.com/docker/go-plugins-helpers --- driver/network_driver.go | 15 +++++++++++++ glide.lock | 48 ++++++++++++++++++++++++++++++++-------- glide.yaml | 1 - main.go | 9 ++++++-- 4 files changed, 61 insertions(+), 12 deletions(-) diff --git a/driver/network_driver.go b/driver/network_driver.go index eb3554f..5f06ff7 100644 --- a/driver/network_driver.go +++ b/driver/network_driver.go @@ -87,6 +87,21 @@ func (d NetworkDriver) GetCapabilities() (*network.CapabilitiesResponse, error) return &resp, nil } +// AllocateNetwork is used for swarm-mode support in remote plugins, which +// Calico's libnetwork-plugin doesn't currently support. +func (d NetworkDriver) AllocateNetwork(request *network.AllocateNetworkRequest) (*network.AllocateNetworkResponse, error) { + var resp network.AllocateNetworkResponse + logutils.JSONMessage("AllocateNetwork response", resp) + return &resp, nil +} + +// FreeNetwork is used for swarm-mode support in remote plugins, which +// Calico's libnetwork-plugin doesn't currently support. +func (d NetworkDriver) FreeNetwork(request *network.FreeNetworkRequest) error { + logutils.JSONMessage("FreeNetwork request", request) + return nil +} + func (d NetworkDriver) CreateNetwork(request *network.CreateNetworkRequest) error { logutils.JSONMessage("CreateNetwork", request) diff --git a/glide.lock b/glide.lock index e73b3b7..7092a46 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 89217814ede547cfb86bfb4c536808aebcb7ba3feed24898f1643c12bf5e23be -updated: 2016-12-13T16:28:16.406100592-08:00 +hash: 479530906fa73fea1b8aa3a7440a2b21e0c9a29a6e580543e7627bec82814744 +updated: 2017-01-19T10:57:27.374927354-08:00 imports: - name: cloud.google.com/go version: 3b1ae45394a234c385be014e9a488f2bb6eef821 @@ -28,14 +28,13 @@ imports: - name: github.com/coreos/go-systemd version: 48702e0da86bd25e76cfef347e2adeb434a0d0a6 subpackages: - - activation + - daemon - journal - util - name: github.com/coreos/pkg version: 3ac0863d7acf3bc44daf49afef8919af12f704ef subpackages: - capnslog - - dlopen - health - httputil - timeutil @@ -68,13 +67,13 @@ imports: - client - pkg/tlsconfig - name: github.com/docker/go-connections - version: 4ccf312bf1d35e5dbda654e57a9be4c3f3cd0366 + version: eb315e36415380e7c2fdee175262560ff42359da subpackages: - nat - sockets - tlsconfig - name: github.com/docker/go-plugins-helpers - version: 8a0198e77ac4e4ee167222caf6894cb32386c5fc + version: 261c0c7fc902aeb7ad448df38e6ee370a3e0e597 subpackages: - ipam - network @@ -126,10 +125,41 @@ imports: - jwriter - name: github.com/Microsoft/go-winio version: 24a3e3d3fc7451805e09d11e11e95d9a0a4f205e -- name: github.com/opencontainers/runc - version: 083933fb9092a3d65d682ba34a08676104c95462 +- name: github.com/onsi/ginkgo + version: 00054c0bb96fc880d4e0be1b90937fad438c5290 + subpackages: + - config + - internal/codelocation + - internal/containernode + - internal/failer + - internal/leafnodes + - internal/remote + - internal/spec + - internal/specrunner + - internal/suite + - internal/testingtproxy + - internal/writer + - reporters + - reporters/stenographer + - reporters/stenographer/support/go-colorable + - reporters/stenographer/support/go-isatty + - types +- name: github.com/onsi/gomega + version: f1f0f388b31eca4e2cbe7a6dd8a3a1dfddda5b1c subpackages: - - libcontainer/user + - format + - gbytes + - gexec + - internal/assertion + - internal/asyncassertion + - internal/oraclematcher + - internal/testingtsupport + - matchers + - matchers/support/goraph/bipartitegraph + - matchers/support/goraph/edge + - matchers/support/goraph/node + - matchers/support/goraph/util + - types - name: github.com/pborman/uuid version: ca53cad383cad2479bbba7f7a1a05797ec1386e4 - name: github.com/pkg/errors diff --git a/glide.yaml b/glide.yaml index 16265fb..0602412 100644 --- a/glide.yaml +++ b/glide.yaml @@ -6,7 +6,6 @@ import: subpackages: - client - package: github.com/docker/go-plugins-helpers - version: 8a0198e77ac4e4ee167222caf6894cb32386c5fc # Need to use old version until we implement AllocateNetwork subpackages: - ipam - network diff --git a/main.go b/main.go index c3d8fd6..c550daa 100644 --- a/main.go +++ b/main.go @@ -50,6 +50,11 @@ func initializeClient() { // VERSION is filled out during the build process (using git describe output) var VERSION string +const ( + // The root user group id is 0 + ROOT_GID = 0 +) + func main() { // Display the version on "-v" // Use a new flag set so as not to conflict with existing libraries which use "flag" @@ -73,14 +78,14 @@ func main() { go func(c chan error) { log.Infoln("calico-net has started.") - err := networkHandler.ServeUnix("root", networkPluginName) + err := networkHandler.ServeUnix(networkPluginName, ROOT_GID) log.Infoln("calico-net has stopped working.") c <- err }(errChannel) go func(c chan error) { log.Infoln("calico-ipam has started.") - err := ipamHandler.ServeUnix("root", ipamPluginName) + err := ipamHandler.ServeUnix(ipamPluginName, ROOT_GID) log.Infoln("calico-ipam has stopped working.") c <- err }(errChannel) From 909474b22eb56d7ec038a15518f152f2ffd335c8 Mon Sep 17 00:00:00 2001 From: JW Bell Date: Tue, 24 Jan 2017 13:27:25 -0800 Subject: [PATCH 05/18] When reporting errors sort flags for consistency. --- driver/network_driver.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/driver/network_driver.go b/driver/network_driver.go index 5f06ff7..0674b4e 100644 --- a/driver/network_driver.go +++ b/driver/network_driver.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "os" + "sort" "strings" "time" @@ -122,8 +123,15 @@ func (d NetworkDriver) CreateNetwork(request *network.CreateNetworkRequest) erro optionSet = len(v) != 0 flagName = "" numFlags := 0 - for mk, _ := range v { - flagName = flagName + "" + mk + ", " + // Sort flags for consistent error reporting + flags := []string{} + for flag := range v { + flags = append(flags, flag) + } + sort.Strings(flags) + + for _, flag := range flags { + flagName = flagName + flag + ", " numFlags++ } multipleFlags = numFlags > 1 From 73248a664b78964fa7ee3902a0939e014485d0de Mon Sep 17 00:00:00 2001 From: Tom Denham Date: Thu, 12 Jan 2017 11:00:52 -0800 Subject: [PATCH 06/18] Update README Add instructions on features and developer instructions. --- README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5cd7a80..5bba4e2 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,32 @@ # Libnetwork plugin for Calico This plugin for Docker networking ([libnetwork](https://github.com/docker/libnetwork)) is intended for use with [Project Calico](http://www.projectcalico.org). -The plugin is integrated with the `calico/node` image which is created from the [calico-containers](https://github.com/projectcalico/calico-containers) repository. +The plugin is integrated with the `calico/node` image which is created from the [calicoctl](https://github.com/projectcalico/calicoctl) repository, but it can also be run in it's own Docker container or as a standalone binary. Guides on how to get started with the plugin and further documentation is available from http://docs.projectcalico.org -The remaining information is for advanced users. +## Supported options for confguration -## How to Run It +### Working with Networks +* When creating a network, the `--subnet` option can be passed to `docker network create`. The subnet must match an existing Calico pool, and any containers created on that network will use an IP address from that Calico Pool. +* Other than `--driver` and `--ipam-driver`, no other options are supported on the `docker network create` command. + +### Working with Containers +When creating containers, use the `--net` option to connect them to a network previously created with `docker network create` + +* The `--ip` option can be passed to `docker run` to assign a specific IP to a container. +* The `--mac` and `--link-local` options are currently unsupported. + +## Working with the code + +* Clone the repo (clone it into your GOPATH and make sure you use projectcalico in the path, not your fork name). +* Create the vendor directory (`make vendor`). This uses `glide` in a docker container to create the vendor directory. +* Build it in a container using `make dist/libnetwork-plugin`. The plugin binary will appear in the `dist` directory. +* Running tests can be done in a container using `make test-containerized`. Note: This works on linux, but can require additional steps on Mac. +* Submit PRs through GitHub. Before merging, you'll be asked to squash your commits together, so 1 PR = 1 commit. +* Before submitting your PR, please make sure tests pass and run `make static-checks`. Both these will be done by the CI system too though. + +## How to Run It During Development `make run-plugin` Running the plugin in a container requires a few specific options From 8314295e5f002c9d8e9d3f4f5b93b18b750dafc8 Mon Sep 17 00:00:00 2001 From: JW Bell Date: Thu, 12 Jan 2017 13:52:41 -0800 Subject: [PATCH 07/18] Add IPv6 support 1. Add IPv6 support to RequestPool 2. Add IPv6 support to RequestAddress 3. Add IPv6 support to CreateNetwork 4. Add IPv6 support to CreateEndpoint 5. Add IPv6 support to Join Also add tests and include a IPv6 section in README.md. --- README.md | 58 ++++++++++++++++- driver/ipam_driver.go | 63 ++++++++++++++----- driver/network_driver.go | 50 ++++++++++++++- .../libnetwork_env_var_test.go | 2 +- .../libnetwork_env_var_test.go | 4 +- tests/default_environment/libnetwork_test.go | 58 +++++++++++++++-- utils/netns/netns.go | 41 +++++++++++- utils/test/test_utils.go | 10 ++- 8 files changed, 254 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 5bba4e2..f478fa7 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,63 @@ On OSX/Windows you can't run Docker natively. To allow the Makefile to write the Run `make test` like this: `LOCAL_USER_ID=1000 LOCAL_GROUP_ID=100 make test-containerized` + +## IPv6 Usage + +*Note: IPv4 can't be disabled, IPv6 is enabled in addition to IPv4.* + +Docker IPv6 support must be enabled e.g. +``` +dockerd --cluster-store=etcd://127.0.0.1:2379 --ipv6 --fixed-cidr-v6="2001:db8:1::/64" +``` + +### Start the libnetwork-plugin + +``` +sudo dist/libnetwork-plugin +``` + +### Add an IPv6 address to the host + +``` +sudo ip addr add fd80:24e2:f998:72d7::1/112 dev eth1 +``` + +### Start calico/node, without using the calico/node libnetwork-plugin, also pass in the host IPv6 address + +``` +sudo calicoctl node run --disable-docker-networking --ip6=fd80:24e2:f998:72d7::1 +``` + +### Create an IPv6 network + +``` +docker network create --ipv6 -d calico --ipam-driver calico-ipam my_net +``` + +### Run containers on the IPv6 network + +``` + docker run --net my_net --name workload-A -tid busybox + docker run --net my_net --name workload-B -tid busybox +``` + + +### Check IPv6 network connectivity + +``` + docker exec workload-A ping -6 -c 4 workload-B.my_net + docker exec workload-B ping -6 -c 4 workload-A.my_net +``` + +### Check IPv4 network connectivity + +``` + docker exec workload-A ping -4 -c 4 workload-B.my_net + docker exec workload-B ping -4 -c 4 workload-A.my_net +``` + + ## Known limitations The following is a list of known limitations when using the Calico libnetwork driver: @@ -60,7 +117,6 @@ driver: once a container endpoint is created, it is possible to manually add additional Calico profiles to that endpoint (effectively adding the container into another network). -- IPv6 is not currently supported ## Configuring diff --git a/driver/ipam_driver.go b/driver/ipam_driver.go index 46d11a0..3fc6516 100644 --- a/driver/ipam_driver.go +++ b/driver/ipam_driver.go @@ -66,17 +66,21 @@ func (i IpamDriver) RequestPool(request *ipam.RequestPoolRequest) (*ipam.Request log.Errorln(err) return nil, err } - + var poolID string + var pool string + var gateway string if request.V6 { - err := errors.New("IPv6 isn't supported") - log.Errorln(err) - return nil, err + // Default the poolID to the fixed value. + poolID = i.poolIDV6 + pool = "::/0" + gateway = "::/0" + } else { + // Default the poolID to the fixed value. + poolID = i.poolIDV4 + pool = "0.0.0.0/0" + gateway = "0.0.0.0/0" } - // Default the poolID to the fixed value. - poolID := i.poolIDV4 - pool := "0.0.0.0/0" - // If a pool (subnet on the CLI) is specified, it must match one of the // preconfigured Calico pools. if request.Pool != "" { @@ -107,7 +111,7 @@ func (i IpamDriver) RequestPool(request *ipam.RequestPoolRequest) (*ipam.Request resp := &ipam.RequestPoolResponse{ PoolID: poolID, Pool: pool, - Data: map[string]string{"com.docker.network.gateway": "0.0.0.0/0"}, + Data: map[string]string{"com.docker.network.gateway": gateway}, } logutils.JSONMessage("RequestPool response", resp) @@ -145,10 +149,20 @@ func (i IpamDriver) RequestAddress(request *ipam.RequestAddressRequest) (*ipam.R // If the poolID isn't the fixed one then find the pool to assign from. // poolV4 defaults to nil to assign from across all pools. var poolV4 []caliconet.IPNet - if request.PoolID != PoolIDV4 { + + var poolV6 []caliconet.IPNet + var numIPv4, numIPv6, version int + if request.PoolID == PoolIDV4 { + version = 4 + numIPv4 = 1 + numIPv6 = 0 + } else if request.PoolID == PoolIDV6 { + version = 6 + numIPv4 = 0 + numIPv6 = 1 + } else { poolsClient := i.client.IPPools() _, ipNet, err := caliconet.ParseCIDR(request.PoolID) - if err != nil { err = errors.Wrapf(err, "Invalid CIDR - %v", request.PoolID) log.Errorln(err) @@ -162,19 +176,26 @@ func (i IpamDriver) RequestAddress(request *ipam.RequestAddressRequest) (*ipam.R log.Errorln(err) return nil, err } - poolV4 = []caliconet.IPNet{caliconet.IPNet{IPNet: pool.Metadata.CIDR.IPNet}} - log.Debugln("Using specific pool ", poolV4) + version = ipNet.Version() + if version == 4 { + poolV4 = []caliconet.IPNet{caliconet.IPNet{IPNet: pool.Metadata.CIDR.IPNet}} + log.Debugln("Using specific pool ", poolV4) + } else if version == 6 { + poolV6 = []caliconet.IPNet{caliconet.IPNet{IPNet: pool.Metadata.CIDR.IPNet}} + log.Debugln("Using specific pool ", poolV6) + } } // Auto assign an IP address. - // IPv4 pool will be nil if the docker network doesn't have a subnet associated with. + // IPv4/v6 pool will be nil if the docker network doesn't have a subnet associated with. // Otherwise, it will be set to the Calico pool to assign from. IPsV4, IPsV6, err := i.client.IPAM().AutoAssign( datastoreClient.AutoAssignArgs{ - Num4: 1, - Num6: 0, + Num4: numIPv4, + Num6: numIPv6, Hostname: hostname, IPv4Pools: poolV4, + IPv6Pools: poolV6, }, ) @@ -212,8 +233,16 @@ func (i IpamDriver) RequestAddress(request *ipam.RequestAddressRequest) (*ipam.R } // Return the IP as a CIDR. + var respAddr string + if IPs[0].Version() == 4 { + // IPv4 address + respAddr = fmt.Sprintf("%v/%v", IPs[0], "32") + } else { + // IPv6 address + respAddr = fmt.Sprintf("%v/%v", IPs[0], "128") + } resp := &ipam.RequestAddressResponse{ - Address: fmt.Sprintf("%v/%v", IPs[0], "32"), + Address: respAddr, } logutils.JSONMessage("RequestAddress response", resp) diff --git a/driver/network_driver.go b/driver/network_driver.go index 0674b4e..1c81dc5 100644 --- a/driver/network_driver.go +++ b/driver/network_driver.go @@ -105,9 +105,19 @@ func (d NetworkDriver) FreeNetwork(request *network.FreeNetworkRequest) error { func (d NetworkDriver) CreateNetwork(request *network.CreateNetworkRequest) error { logutils.JSONMessage("CreateNetwork", request) - + knownOpts := map[string]bool{"com.docker.network.enable_ipv6": true} // Reject all options (--internal, --enable_ipv6, etc) for k, v := range request.Options { + skip := false + for known, _ := range knownOpts { + if k == known { + skip = true + break + } + } + if skip { + continue + } optionSet := false flagName := k flagValue := fmt.Sprintf("%s", v) @@ -159,9 +169,20 @@ func (d NetworkDriver) CreateNetwork(request *network.CreateNetworkRequest) erro for _, ipData := range request.IPv4Data { // Older version of Docker have a bug where they don't provide the correct AddressSpace // so we can't check for calico IPAM using our known address space. + // The Docker issue, https://github.com/projectcalico/libnetwork-plugin/issues/77, + // was fixed sometime between 1.11.2 and 1.12.3. // Also the pool might not have a fixed values if --subnet was passed // So the only safe thing is to check for our special gateway value if ipData.Gateway != "0.0.0.0/0" { + err := errors.New("Non-Calico IPAM driver is used. Note: Docker before 1.12.3 is unsupported") + log.Errorln(err) + return err + } + } + + for _, ipData := range request.IPv6Data { + // Don't support older versions of Docker which have a bug where the correct AddressSpace isn't provided + if ipData.AddressSpace != CalicoGlobalAddressSpace { err := errors.New("Non-Calico IPAM driver is used") log.Errorln(err) return err @@ -188,7 +209,7 @@ func (d NetworkDriver) CreateEndpoint(request *network.CreateEndpointRequest) (* } log.Debugf("Creating endpoint %v\n", request.EndpointID) - if request.Interface.Address == "" { + if request.Interface.Address == "" && request.Interface.AddressIPv6 == "" { err := errors.New("No address assigned for endpoint") log.Errorln(err) return nil, err @@ -209,6 +230,18 @@ func (d NetworkDriver) CreateEndpoint(request *network.CreateEndpointRequest) (* addresses = append(addresses, caliconet.IPNet{IPNet: net.IPNet{IP: ip4, Mask: net.CIDRMask(32, 32)}}) } + if request.Interface.AddressIPv6 != "" { + // Parse the address this function was passed. + ip6, ipnet, err := net.ParseCIDR(request.Interface.AddressIPv6) + log.Debugf("Parsed IP %v from (%v) \n", ip6, request.Interface.AddressIPv6) + if err != nil { + err = errors.Wrapf(err, "Parsing %v as CIDR failed", request.Interface.AddressIPv6) + log.Errorln(err) + return nil, err + } + addresses = append(addresses, caliconet.IPNet{IPNet: *ipnet}) + } + endpoint := api.NewWorkloadEndpoint() endpoint.Metadata.Node = hostname endpoint.Metadata.Orchestrator = d.orchestratorID @@ -371,6 +404,19 @@ func (d NetworkDriver) Join(request *network.JoinRequest) (*network.JoinResponse NextHop: "", }) + linkLocalAddr := netns.GetLinkLocalAddr(hostInterfaceName) + if linkLocalAddr == nil { + log.Warnf("No IPv6 link local address for %s", hostInterfaceName) + } else { + resp.GatewayIPv6 = fmt.Sprintf("%s", linkLocalAddr) + nextHopIPv6 := fmt.Sprintf("%s/128", linkLocalAddr) + resp.StaticRoutes = append(resp.StaticRoutes, &network.StaticRoute{ + Destination: nextHopIPv6, + RouteType: 1, // 1 = CONNECTED + NextHop: "", + }) + } + logutils.JSONMessage("Join response", resp) return resp, nil diff --git a/tests/custom_if_prefix/libnetwork_env_var_test.go b/tests/custom_if_prefix/libnetwork_env_var_test.go index c466d26..7e5591e 100644 --- a/tests/custom_if_prefix/libnetwork_env_var_test.go +++ b/tests/custom_if_prefix/libnetwork_env_var_test.go @@ -17,7 +17,7 @@ var _ = Describe("Running plugin with custom ENV", func() { RunPlugin("-e CALICO_LIBNETWORK_IFPREFIX=test") // Since running the plugin starts etcd, the pool needs to be created after. - CreatePool("192.169.0.0/16") + CreatePool("192.169.0.0/16", false) name := fmt.Sprintf("run%d", rand.Uint32()) DockerString(fmt.Sprintf("docker network create %s -d calico --ipam-driver calico-ipam", name)) diff --git a/tests/custom_wep_labelling/libnetwork_env_var_test.go b/tests/custom_wep_labelling/libnetwork_env_var_test.go index 202fc4b..0c1de79 100644 --- a/tests/custom_wep_labelling/libnetwork_env_var_test.go +++ b/tests/custom_wep_labelling/libnetwork_env_var_test.go @@ -17,7 +17,7 @@ var _ = Describe("Running plugin with custom ENV", func() { RunPlugin("-e CALICO_LIBNETWORK_LABEL_ENDPOINTS=true") // Since running the plugin starts etcd, the pool needs to be created after. - CreatePool("192.169.1.0/24") + CreatePool("192.169.1.0/24", false) name := fmt.Sprintf("run%d", rand.Uint32()) DockerString(fmt.Sprintf("docker network create %s -d calico --ipam-driver calico-ipam", name)) @@ -61,7 +61,7 @@ var _ = Describe("Running plugin with custom ENV", func() { RunPlugin("-e CALICO_LIBNETWORK_LABEL_ENDPOINTS=true -e CALICO_LIBNETWORK_CREATE_PROFILES=false") // Since running the plugin starts etcd, the pool needs to be created after. - CreatePool("192.169.2.0/24") + CreatePool("192.169.2.0/24", true) name := fmt.Sprintf("run%d", rand.Uint32()) DockerString(fmt.Sprintf("docker network create %s -d calico --ipam-driver calico-ipam", name)) diff --git a/tests/default_environment/libnetwork_test.go b/tests/default_environment/libnetwork_test.go index 756f196..1f428b5 100644 --- a/tests/default_environment/libnetwork_test.go +++ b/tests/default_environment/libnetwork_test.go @@ -16,7 +16,8 @@ import ( var _ = Describe("Libnetwork Tests", func() { BeforeEach(func() { WipeEtcd() - CreatePool("192.169.0.0/16") + CreatePool("192.169.0.0/16", false) + CreatePool("2001:db8::/32", true) }) // Run the plugin just once for all tests in this file. @@ -82,8 +83,9 @@ var _ = Describe("Libnetwork Tests", func() { session := DockerSession("docker network create success$RANDOM --subnet 192.169.0.0/16 -d calico --ipam-driver calico-ipam") Eventually(session).Should(Exit(0)) }) - - PIt("creates a network with IPv6", func() { //TODO - IPv6 support + It("creates a network with IPv6", func() { + session := DockerSession("docker network create --ipv6 success$RANDOM -d calico --ipam-driver calico-ipam") + Eventually(session).Should(Exit(0)) }) PIt("creates a network with IPv6 from a specific subnet", func() { }) @@ -290,6 +292,54 @@ var _ = Describe("Libnetwork Tests", func() { }) - //docker stop/rm - stop and rm are the same as far as the plugin is concerned + Describe("docker run ipv6", func() { + var name string + BeforeEach(func() { + name = fmt.Sprintf("run%d", rand.Uint32()) + DockerString(fmt.Sprintf("docker network create --ipv6 %s -d calico --ipam-driver calico-ipam", name)) + }) + AfterEach(func() { + DockerString(fmt.Sprintf("docker network rm %s", name)) + }) + + It("creates a container on a network and checks all assertions", func() { + // Create a container that will just sit in the background + DockerString(fmt.Sprintf("docker run --net %s -tid --name %s busybox", name, name)) + + // Gather information for assertions + docker_endpoint := GetDockerEndpoint(name, name) + ip := docker_endpoint.IPAddress + ipv6 := docker_endpoint.GlobalIPv6Address + mac := docker_endpoint.MacAddress + endpoint_id := docker_endpoint.EndpointID + interface_name := "cali" + endpoint_id[:mathutils.MinInt(11, len(endpoint_id))] + + // Check that the endpoint is created in etcd + etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) + Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( + `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":["%s/128"]}`, + interface_name, mac, name, ip, ipv6))) + + // Check the interface exists on the Host - it has an autoassigned + // mac and ip, so don't check anything! + DockerString(fmt.Sprintf("ip addr show %s", interface_name)) + DockerString(fmt.Sprintf("ip -6 addr show %s", interface_name)) + + // Make sure the interface in the container exists and has the assigned ipv6 and mac + container_interface_string := DockerString(fmt.Sprintf("docker exec -i %s ip addr", name)) + Expect(container_interface_string).Should(ContainSubstring(ipv6)) + Expect(container_interface_string).Should(ContainSubstring(mac)) + + // Make sure the container has the routes we expect + routes := DockerString(fmt.Sprintf("docker exec -i %s ip route", name)) + Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0")) + routes6 := DockerString(fmt.Sprintf("docker exec -i %s ip -6 route", name)) + Expect(routes6).Should(MatchRegexp("default via fe80::.* dev cali0 metric 1024")) + + // Delete container + DockerString(fmt.Sprintf("docker rm -f %s", name)) + }) + }) + //Docker stop/rm - stop and rm are the same as far as the plugin is concerned // TODO - check that the endpoint is removed from etcd and that the veth is removed }) diff --git a/utils/netns/netns.go b/utils/netns/netns.go index 7ef7a83..26a3bf4 100644 --- a/utils/netns/netns.go +++ b/utils/netns/netns.go @@ -1,7 +1,11 @@ package netns import ( + "fmt" "net" + "syscall" + + log "github.com/Sirupsen/logrus" "github.com/pkg/errors" "github.com/vishvananda/netlink" @@ -17,9 +21,17 @@ func CreateVeth(vethNameHost, vethNameNSTemp string) error { if err := netlink.LinkAdd(veth); err != nil { return err } - - err := netlink.LinkSetUp(veth) - return err + vethTemp := &netlink.Veth{ + LinkAttrs: netlink.LinkAttrs{ + Name: vethNameNSTemp, + }, + PeerName: vethNameHost, + } + // Set link state to up for both host and temp, + if err := netlink.LinkSetUp(vethTemp); err != nil { + return err + } + return netlink.LinkSetUp(veth) } func SetVethMac(vethNameHost, mac string) error { @@ -59,3 +71,26 @@ func IsVethExists(vethHostName string) (bool, error) { } return false, nil } + +// GetLinkLocalAddr Get the IPv6 link local address of interfaceName +func GetLinkLocalAddr(interfaceName string) net.IP { + link, err := netlink.LinkByName(interfaceName) + if err != nil { + log.Fatal(err) + } + addrs, err := netlink.AddrList(link, netlink.FAMILY_V6) + if err != nil { + log.Fatal(err) + } + var linkLocalAddr net.IP + for _, addr := range addrs { + if addr.Scope == syscall.RT_SCOPE_LINK { + linkLocalAddr = addr.IP + break + } + } + if linkLocalAddr == nil { + log.Warn(fmt.Sprintf("No IPv6 link local address found for interface: %s", interfaceName)) + } + return linkLocalAddr +} diff --git a/utils/test/test_utils.go b/utils/test/test_utils.go index 020cd27..7b16c9e 100644 --- a/utils/test/test_utils.go +++ b/utils/test/test_utils.go @@ -57,9 +57,15 @@ func GetEtcdString(path string) string { } // CreatePool creates a pool in etcd -func CreatePool(pool string) { +func CreatePool(pool string, ipv6 bool) { + var ipv string + if ipv6 { + ipv = "v6" + } else { + ipv = "v4" + } _, err := kapi.Set(context.Background(), - fmt.Sprintf("/calico/v1/ipam/v4/pool/%s", strings.Replace(pool, "/", "-", -1)), + fmt.Sprintf("/calico/v1/ipam/%s/pool/%s", ipv, strings.Replace(pool, "/", "-", -1)), fmt.Sprintf(`{"cidr": "%s"}`, pool), nil) if err != nil { panic(err) From eb65e90d9a75318aa1d412dc7b722600ff9b9f98 Mon Sep 17 00:00:00 2001 From: JW Bell Date: Tue, 7 Mar 2017 16:05:52 -0800 Subject: [PATCH 08/18] Update docker pkg to v17.03.0-ce and update libcalico-go pkg to 1.1.1 --- glide.lock | 45 +++++++++++++++++++++++++++++---------------- glide.yaml | 4 ++-- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/glide.lock b/glide.lock index 7092a46..84ecd2b 100644 --- a/glide.lock +++ b/glide.lock @@ -1,11 +1,6 @@ -hash: 479530906fa73fea1b8aa3a7440a2b21e0c9a29a6e580543e7627bec82814744 -updated: 2017-01-19T10:57:27.374927354-08:00 +hash: 2e2632b28f2c6ba1b8550bb531f5e51dfb2ba5203437f68906c2b7df04fabf49 +updated: 2017-03-07T13:56:22.981382558-08:00 imports: -- name: cloud.google.com/go - version: 3b1ae45394a234c385be014e9a488f2bb6eef821 - subpackages: - - compute/metadata - - internal - name: github.com/blang/semver version: 31b736133b98f26d5e078ec9eb591666edfd091f - name: github.com/coreos/etcd @@ -43,12 +38,12 @@ imports: subpackages: - spew - name: github.com/docker/distribution - version: 923c7763b0e49cbb9f34da368108e8dde34e009d + version: cd27f179f2c10c5d300e6d09025b538c475b0d51 subpackages: - digest - reference - name: github.com/docker/docker - version: 4d92237de1b34c8bf99e549db27b83fd087cd765 + version: 60ccb2265b0574d6c1c1090876a1d1ab32bed60e subpackages: - api/types - api/types/blkiodev @@ -115,6 +110,8 @@ imports: version: 6633656539c1639d9d78127b7d47c622b5d7b6dc - name: github.com/jonboulle/clockwork version: 2eee05ed794112d45db504eb05aa693efd2b8b09 +- name: github.com/juju/ratelimit + version: 77ed1c8a01217656d2080ad51981f6e99adaa177 - name: github.com/kelseyhightower/envconfig version: 5c008110b20b657eb7e005b83d0a5f6aa6bb5f4b - name: github.com/mailru/easyjson @@ -173,7 +170,7 @@ imports: - name: github.com/projectcalico/go-yaml-wrapper version: 598e54215bee41a19677faa4f0c32acd2a87eb56 - name: github.com/projectcalico/libcalico-go - version: f87d39740b5a49891d6ee2646a17326c5e337b20 + version: 8de5b8d6e6f0a44208f033e208a2dec986abedb8 subpackages: - lib/api - lib/api/unversioned @@ -182,14 +179,21 @@ imports: - lib/backend/compat - lib/backend/etcd - lib/backend/k8s + - lib/backend/k8s/resources - lib/backend/k8s/thirdparty - lib/backend/model - lib/client - lib/errors + - lib/hash - lib/hwm + - lib/ipip - lib/net - lib/numorstring - lib/scope + - lib/selector + - lib/selector/parser + - lib/selector/tokenizer + - lib/validator - name: github.com/PuerkitoBio/purell version: 8a290539e2e8629dbc4e6bad948158f790ec31f4 - name: github.com/PuerkitoBio/urlesc @@ -197,7 +201,7 @@ imports: - name: github.com/satori/go.uuid version: b061729afc07e77a8aa4fad0a2fd840958f1942a - name: github.com/Sirupsen/logrus - version: 881bee4e20a5d11a6a88a5667c6f292072ac1963 + version: 0208149b40d863d2c1a2f8fe5753096a9cf2cc8b - name: github.com/spf13/pflag version: 08b1a584251b5b62f458943640fc8ebd4d50aaa5 - name: github.com/ugorji/go @@ -226,7 +230,7 @@ imports: - idna - proxy - name: golang.org/x/oauth2 - version: 3c3a985cb79f52a3190fbc056984415ca6763d01 + version: 045497edb6234273d67dbc25da3f2ddbc4c4cacf subpackages: - google - internal @@ -251,7 +255,7 @@ imports: - unicode/norm - width - name: google.golang.org/appengine - version: 4f7eeb5305a4ba1966344836ba4af9996b7b4e05 + version: 12d5545dc1cfa6047a286d5e853841b6471f4c19 subpackages: - internal - internal/app_identity @@ -262,6 +266,15 @@ imports: - internal/remote_api - internal/urlfetch - urlfetch +- name: google.golang.org/cloud + version: 975617b05ea8a58727e6c1a06b6161ff4185a9f2 + subpackages: + - compute/metadata + - internal + - internal/opts + - storage +- name: gopkg.in/go-playground/validator.v8 + version: 5f57d2222ad794d0dffb07e664ea05e2ee07d60c - name: gopkg.in/inf.v0 version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 - name: gopkg.in/tchap/go-patricia.v2 @@ -271,7 +284,7 @@ imports: - name: gopkg.in/yaml.v2 version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 - name: k8s.io/client-go - version: 41a99d711af778a177f07402217b85d456b50da1 + version: 243d8a9cb66a51ad8676157f79e71033b4014a2a subpackages: - discovery - kubernetes @@ -291,7 +304,6 @@ imports: - pkg/api/errors - pkg/api/install - pkg/api/meta - - pkg/api/meta/metatypes - pkg/api/resource - pkg/api/unversioned - pkg/api/v1 @@ -321,6 +333,8 @@ imports: - pkg/apis/extensions - pkg/apis/extensions/install - pkg/apis/extensions/v1beta1 + - pkg/apis/meta/v1 + - pkg/apis/meta/v1/unstructured - pkg/apis/policy - pkg/apis/policy/install - pkg/apis/policy/v1beta1 @@ -364,7 +378,6 @@ imports: - pkg/util/net - pkg/util/parsers - pkg/util/rand - - pkg/util/ratelimit - pkg/util/runtime - pkg/util/sets - pkg/util/uuid diff --git a/glide.yaml b/glide.yaml index 0602412..cf610f6 100644 --- a/glide.yaml +++ b/glide.yaml @@ -2,7 +2,7 @@ package: github.com/projectcalico/libnetwork-plugin import: - package: github.com/Sirupsen/logrus - package: github.com/docker/docker - version: v1.13.0-rc3 + version: v17.03.0-ce subpackages: - client - package: github.com/docker/go-plugins-helpers @@ -11,7 +11,7 @@ import: - network - package: github.com/pkg/errors - package: github.com/projectcalico/libcalico-go - version: v1.0.0-rc6 + version: v1.1.1 subpackages: - lib/api - lib/client From 0d29fdf46e5e5cfe2c1795e43fcfc199d507bec3 Mon Sep 17 00:00:00 2001 From: Ethan Chu Date: Tue, 21 Mar 2017 11:31:00 +0800 Subject: [PATCH 09/18] Fix typo in `DiscoverDelete` log --- driver/network_driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/network_driver.go b/driver/network_driver.go index 1c81dc5..af950c8 100644 --- a/driver/network_driver.go +++ b/driver/network_driver.go @@ -436,7 +436,7 @@ func (d NetworkDriver) DiscoverNew(request *network.DiscoveryNotification) error } func (d NetworkDriver) DiscoverDelete(request *network.DiscoveryNotification) error { - logutils.JSONMessage("DiscoverNew", request) + logutils.JSONMessage("DiscoverDelete", request) log.Debugln("DiscoverDelete response JSON={}") return nil } From d02096e4d8bd55ff537d33fd82d9b99ff7071ff7 Mon Sep 17 00:00:00 2001 From: Ethan Chu Date: Tue, 21 Mar 2017 15:44:25 +0800 Subject: [PATCH 10/18] No need to remove `calico-etcd-ssl` in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9e8ca5c..6e0ab4b 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ static-checks: vendor gometalinter --deadline=30s --disable-all --enable=goimports --enable=vet --enable=errcheck --enable=varcheck --enable=unused --enable=dupl $$(glide nv)' run-etcd: - @-docker rm -f calico-etcd calico-etcd-ssl + @-docker rm -f calico-etcd docker run --detach \ --net=host \ --name calico-etcd quay.io/coreos/etcd \ From cdce45177cfdcb2b69e3a528361ab752963ffed4 Mon Sep 17 00:00:00 2001 From: Tom Denham Date: Fri, 5 May 2017 14:24:50 -0700 Subject: [PATCH 11/18] Add Github templates --- .github/ISSUE_TEMPLATE.md | 34 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 12 +++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..ba76425 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,34 @@ + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + +## Steps to Reproduce (for bugs) + + +1. +2. +3. +4. + +## Context + + + +## Your Environment + +* Docker version: +* Libnetwork-plugin version: +* How you deployed the libnetwork plugin: +* Operating System and version: +* Link to your project (optional): + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e52c35f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ +## Description +A few sentences describing the overall goals of the pull request's commits. +Please include +- the type of fix - (e.g. bug fix, new feature, documentation) +- some details on _why_ this PR should be merged +- the details of the testing you've done on it (both manual and automated) +- which components are affected by this PR + +## Todos +- [ ] Tests +- [ ] Documentation + From 0be50cf37e1e36f77002e237625485d6584cdb0b Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 19 Jun 2017 16:15:36 -0700 Subject: [PATCH 12/18] Remove image push from makefile Removing image pushes from the makefile to prevent tampering --- Makefile | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Makefile b/Makefile index 6e0ab4b..eb7a7f7 100644 --- a/Makefile +++ b/Makefile @@ -74,19 +74,6 @@ run-etcd: --advertise-client-urls "http://$(LOCAL_IP_ENV):2379,http://127.0.0.1:2379" \ --listen-client-urls "http://0.0.0.0:2379" -semaphore: test-containerized - set -e; \ - if [ -z $$PULL_REQUEST_NUMBER ]; then \ - $(MAKE) $(CONTAINER_NAME); \ - docker tag $(CONTAINER_NAME) $(CONTAINER_NAME):$$BRANCH_NAME && docker push $(CONTAINER_NAME):$$BRANCH_NAME; \ - docker tag $(CONTAINER_NAME) quay.io/$(CONTAINER_NAME):$$BRANCH_NAME && docker push quay.io/$(CONTAINER_NAME):$$BRANCH_NAME; \ - if [ "$$BRANCH_NAME" = "master" ]; then \ - export VERSION=`git describe --tags --dirty`; \ - docker tag $(CONTAINER_NAME) $(CONTAINER_NAME):$$VERSION && docker push $(CONTAINER_NAME):$$VERSION; \ - docker tag $(CONTAINER_NAME) quay.io/$(CONTAINER_NAME):$$VERSION && docker push quay.io/$(CONTAINER_NAME):$$VERSION; \ - fi; \ - fi - release: clean ifndef VERSION $(error VERSION is undefined - run using make release VERSION=vX.Y.Z) From d10d4c142fb2a1554d6264eb8ee504fd7e39226c Mon Sep 17 00:00:00 2001 From: Rob Brockbank Date: Fri, 21 Jul 2017 09:57:15 -0700 Subject: [PATCH 13/18] ip route output now includes scope link --- Makefile | 2 +- tests/custom_if_prefix/libnetwork_env_var_test.go | 2 +- tests/default_environment/libnetwork_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index eb7a7f7..bba50ff 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ endif git tag $(VERSION) $(MAKE) $(CONTAINER_NAME) # Check that the version output appears on a line of its own (the -x option to grep). -# Tests that the "git tag" makes it into the binary. Main point is to catch "-dirty" builds + # Tests that the "git tag" makes it into the binary. Main point is to catch "-dirty" builds @echo "Checking if the tag made it into the binary" docker run --rm calico/libnetwork-plugin -v | grep -x $(VERSION) || (echo "Reported version:" `docker run --rm calico/libnetwork-plugin -v` "\nExpected version: $(VERSION)" && exit 1) docker tag calico/libnetwork-plugin calico/libnetwork-plugin:$(VERSION) diff --git a/tests/custom_if_prefix/libnetwork_env_var_test.go b/tests/custom_if_prefix/libnetwork_env_var_test.go index 7e5591e..31e610d 100644 --- a/tests/custom_if_prefix/libnetwork_env_var_test.go +++ b/tests/custom_if_prefix/libnetwork_env_var_test.go @@ -57,7 +57,7 @@ var _ = Describe("Running plugin with custom ENV", func() { // Make sure the container has the routes we expect routes := DockerString(fmt.Sprintf("docker exec -i %s ip route", name)) - Expect(routes).Should(Equal("default via 169.254.1.1 dev test0 \n169.254.1.1 dev test0")) + Expect(routes).Should(Equal("default via 169.254.1.1 dev test0 \n169.254.1.1 dev test0 scope link")) // Delete container DockerString(fmt.Sprintf("docker rm -f %s", name)) diff --git a/tests/default_environment/libnetwork_test.go b/tests/default_environment/libnetwork_test.go index 1f428b5..17cef61 100644 --- a/tests/default_environment/libnetwork_test.go +++ b/tests/default_environment/libnetwork_test.go @@ -174,7 +174,7 @@ var _ = Describe("Libnetwork Tests", func() { // Make sure the container has the routes we expect routes := DockerString(fmt.Sprintf("docker exec -i %s ip route", name)) - Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0")) + Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0 scope link")) // Delete container DockerString(fmt.Sprintf("docker rm -f %s", name)) @@ -211,7 +211,7 @@ var _ = Describe("Libnetwork Tests", func() { // Make sure the container has the routes we expect routes := DockerString(fmt.Sprintf("docker exec -i %s ip route", name)) - Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0")) + Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0 scope link")) // Delete container DockerString(fmt.Sprintf("docker rm -f %s", name)) @@ -262,7 +262,7 @@ var _ = Describe("Libnetwork Tests", func() { // Make sure the container has the routes we expect routes := DockerString(fmt.Sprintf("docker exec -i %s ip route", name_subnet)) - Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0")) + Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0 scope link")) // Delete container and network DockerString(fmt.Sprintf("docker rm -f %s", name_subnet)) @@ -332,7 +332,7 @@ var _ = Describe("Libnetwork Tests", func() { // Make sure the container has the routes we expect routes := DockerString(fmt.Sprintf("docker exec -i %s ip route", name)) - Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0")) + Expect(routes).Should(Equal("default via 169.254.1.1 dev cali0 \n169.254.1.1 dev cali0 scope link")) routes6 := DockerString(fmt.Sprintf("docker exec -i %s ip -6 route", name)) Expect(routes6).Should(MatchRegexp("default via fe80::.* dev cali0 metric 1024")) From ecb3f42076440fa12f2b006e103073992fd2f444 Mon Sep 17 00:00:00 2001 From: Rob Brockbank Date: Mon, 24 Jul 2017 12:14:03 -0700 Subject: [PATCH 14/18] Rev libcalico-go to 1.5.0 --- glide.lock | 247 +++++++----------- glide.yaml | 2 +- .../libnetwork_env_var_test.go | 2 +- .../libnetwork_env_var_test.go | 4 +- tests/default_environment/libnetwork_test.go | 10 +- 5 files changed, 99 insertions(+), 166 deletions(-) diff --git a/glide.lock b/glide.lock index 84ecd2b..039cc90 100644 --- a/glide.lock +++ b/glide.lock @@ -1,38 +1,19 @@ -hash: 2e2632b28f2c6ba1b8550bb531f5e51dfb2ba5203437f68906c2b7df04fabf49 -updated: 2017-03-07T13:56:22.981382558-08:00 +hash: cd18acbde6b160f9405bdf2df246fc6c763536a58e331c73e7f86763b034d97a +updated: 2017-07-24T19:05:58.33834663Z imports: -- name: github.com/blang/semver - version: 31b736133b98f26d5e078ec9eb591666edfd091f - name: github.com/coreos/etcd - version: cdde0368ad6de945cf262e529cf950c9e0922a49 + version: 17ae440991da3bdb2df4309936dd2074f66ec394 subpackages: - client - - pkg/fileutil - pkg/pathutil - pkg/tlsutil - pkg/transport - pkg/types -- name: github.com/coreos/go-oidc - version: 5644a2f50e2d2d5ba0b474bc5bc55fea1925936d + - version +- name: github.com/coreos/go-semver + version: 568e959cd89871e61434c1143528d9162da89ef2 subpackages: - - http - - jose - - key - - oauth2 - - oidc -- name: github.com/coreos/go-systemd - version: 48702e0da86bd25e76cfef347e2adeb434a0d0a6 - subpackages: - - daemon - - journal - - util -- name: github.com/coreos/pkg - version: 3ac0863d7acf3bc44daf49afef8919af12f704ef - subpackages: - - capnslog - - health - - httputil - - timeutil + - semver - name: github.com/davecgh/go-spew version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d subpackages: @@ -76,7 +57,7 @@ imports: - name: github.com/docker/go-units version: e30f1e79f3cd72542f2026ceec18d3bd67ab859c - name: github.com/emicklei/go-restful - version: 89ef8af493ab468a45a42bb0d89a06fccdd2fb22 + version: 09691a3b6378b740595c1002f40c34dd5f218a22 subpackages: - log - swagger @@ -97,23 +78,16 @@ imports: - sortkeys - name: github.com/golang/glog version: 44145f04b68cf362d9c4df2182967c2275eaefed -- name: github.com/golang/protobuf - version: 4bd1920723d7b7c925de087aa32e2187708897f7 - subpackages: - - jsonpb - - proto - name: github.com/google/gofuzz - version: bbcb9da2d746f8bdbd6a936686a0a6067ada0ec5 + version: 44d81051d367757e1c7c6a5a86423ece9afcf63c - name: github.com/howeyc/gopass version: 3ca23474a7c7203e0a0a070fd33508f6efdb9b3d - name: github.com/imdario/mergo version: 6633656539c1639d9d78127b7d47c622b5d7b6dc -- name: github.com/jonboulle/clockwork - version: 2eee05ed794112d45db504eb05aa693efd2b8b09 - name: github.com/juju/ratelimit version: 77ed1c8a01217656d2080ad51981f6e99adaa177 - name: github.com/kelseyhightower/envconfig - version: 5c008110b20b657eb7e005b83d0a5f6aa6bb5f4b + version: 8bf4bbfc795e2c7c8a5ea47b707453ed019e2ad4 - name: github.com/mailru/easyjson version: d5b7844b561a7bc640052f1b935f7b800330d7e0 subpackages: @@ -123,7 +97,7 @@ imports: - name: github.com/Microsoft/go-winio version: 24a3e3d3fc7451805e09d11e11e95d9a0a4f205e - name: github.com/onsi/ginkgo - version: 00054c0bb96fc880d4e0be1b90937fad438c5290 + version: f40a49d81e5c12e90400620b6242fb29a8e7c9d9 subpackages: - config - internal/codelocation @@ -132,6 +106,7 @@ imports: - internal/leafnodes - internal/remote - internal/spec + - internal/spec_iterator - internal/specrunner - internal/suite - internal/testingtproxy @@ -142,7 +117,7 @@ imports: - reporters/stenographer/support/go-isatty - types - name: github.com/onsi/gomega - version: f1f0f388b31eca4e2cbe7a6dd8a3a1dfddda5b1c + version: 9b8c753e8dfb382618ba8fa19b4197b5dcb0434c subpackages: - format - gbytes @@ -157,8 +132,6 @@ imports: - matchers/support/goraph/node - matchers/support/goraph/util - types -- name: github.com/pborman/uuid - version: ca53cad383cad2479bbba7f7a1a05797ec1386e4 - name: github.com/pkg/errors version: 248dadf4e9068a0b3e79f02ed0a610d935de5302 - name: github.com/projectcalico/go-json @@ -170,7 +143,7 @@ imports: - name: github.com/projectcalico/go-yaml-wrapper version: 598e54215bee41a19677faa4f0c32acd2a87eb56 - name: github.com/projectcalico/libcalico-go - version: 8de5b8d6e6f0a44208f033e208a2dec986abedb8 + version: e1ab5e5bf4a57ea6fa71bf4a7712af27b824a005 subpackages: - lib/api - lib/api/unversioned @@ -183,6 +156,7 @@ imports: - lib/backend/k8s/thirdparty - lib/backend/model - lib/client + - lib/converter - lib/errors - lib/hash - lib/hwm @@ -201,19 +175,19 @@ imports: - name: github.com/satori/go.uuid version: b061729afc07e77a8aa4fad0a2fd840958f1942a - name: github.com/Sirupsen/logrus - version: 0208149b40d863d2c1a2f8fe5753096a9cf2cc8b + version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f - name: github.com/spf13/pflag version: 08b1a584251b5b62f458943640fc8ebd4d50aaa5 - name: github.com/ugorji/go - version: 9c7f9b7a2bc3a520f7c7b30b34b7f85f47fe27b6 + version: ded73eae5db7e7a0ef6f55aace87a2873c5d2b74 subpackages: - codec - name: github.com/vishvananda/netlink - version: 05458f39209fe6d1610c1cb2ac4cdaa9a5b02e36 + version: fe3b5664d23a11b52ba59bece4ff29c52772a56b subpackages: - nl - name: github.com/vishvananda/netns - version: 8ba1072b58e0c2a240eb5f6120165c7776c3e7b8 + version: 54f0e4339ce73702a0607f49922aaa1e749b418d - name: golang.org/x/crypto version: 1351f936d976c60a0a48d728281922cf63eafb8d subpackages: @@ -221,30 +195,25 @@ imports: - blowfish - ssh/terminal - name: golang.org/x/net - version: 6acef71eb69611914f7a30939ea9f6e194c78172 + version: f2499483f923065a842d38eb4c7f1927e6fc6e6d subpackages: - context - context/ctxhttp - http2 - http2/hpack - idna + - lex/httplex - proxy -- name: golang.org/x/oauth2 - version: 045497edb6234273d67dbc25da3f2ddbc4c4cacf - subpackages: - - google - - internal - - jws - - jwt - name: golang.org/x/sys version: 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9 subpackages: - unix - windows - name: golang.org/x/text - version: 2910a502d2bf9e43193af9d68ca516529614eed3 + version: 19e51611da83d6be54ddafce4a4af510cb3e9ea4 subpackages: - cases + - internal - internal/tag - language - runes @@ -254,25 +223,6 @@ imports: - unicode/bidi - unicode/norm - width -- name: google.golang.org/appengine - version: 12d5545dc1cfa6047a286d5e853841b6471f4c19 - subpackages: - - internal - - internal/app_identity - - internal/base - - internal/datastore - - internal/log - - internal/modules - - internal/remote_api - - internal/urlfetch - - urlfetch -- name: google.golang.org/cloud - version: 975617b05ea8a58727e6c1a06b6161ff4185a9f2 - subpackages: - - compute/metadata - - internal - - internal/opts - - storage - name: gopkg.in/go-playground/validator.v8 version: 5f57d2222ad794d0dffb07e664ea05e2ee07d60c - name: gopkg.in/inf.v0 @@ -283,115 +233,128 @@ imports: - patricia - name: gopkg.in/yaml.v2 version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 +- name: k8s.io/apimachinery + version: b317fa7ec8e0e7d1f77ac63bf8c3ec7b29a2a215 + subpackages: + - pkg/api/errors + - pkg/api/meta + - pkg/api/resource + - pkg/apimachinery + - pkg/apimachinery/announced + - pkg/apimachinery/registered + - pkg/apis/meta/v1 + - pkg/apis/meta/v1/unstructured + - pkg/conversion + - pkg/conversion/queryparams + - pkg/fields + - pkg/labels + - pkg/openapi + - pkg/runtime + - pkg/runtime/schema + - pkg/runtime/serializer + - pkg/runtime/serializer/json + - pkg/runtime/serializer/protobuf + - pkg/runtime/serializer/recognizer + - pkg/runtime/serializer/streaming + - pkg/runtime/serializer/versioning + - pkg/selection + - pkg/types + - pkg/util/diff + - pkg/util/errors + - pkg/util/framer + - pkg/util/intstr + - pkg/util/json + - pkg/util/net + - pkg/util/rand + - pkg/util/runtime + - pkg/util/sets + - pkg/util/validation + - pkg/util/validation/field + - pkg/util/wait + - pkg/util/yaml + - pkg/version + - pkg/watch + - third_party/forked/golang/reflect - name: k8s.io/client-go - version: 243d8a9cb66a51ad8676157f79e71033b4014a2a + version: 4a3ab2f5be5177366f8206fd79ce55ca80e417fa subpackages: - discovery - kubernetes + - kubernetes/scheme - kubernetes/typed/apps/v1beta1 + - kubernetes/typed/authentication/v1 - kubernetes/typed/authentication/v1beta1 + - kubernetes/typed/authorization/v1 - kubernetes/typed/authorization/v1beta1 - kubernetes/typed/autoscaling/v1 + - kubernetes/typed/autoscaling/v2alpha1 - kubernetes/typed/batch/v1 - kubernetes/typed/batch/v2alpha1 - - kubernetes/typed/certificates/v1alpha1 + - kubernetes/typed/certificates/v1beta1 - kubernetes/typed/core/v1 - kubernetes/typed/extensions/v1beta1 - kubernetes/typed/policy/v1beta1 - kubernetes/typed/rbac/v1alpha1 + - kubernetes/typed/rbac/v1beta1 + - kubernetes/typed/settings/v1alpha1 + - kubernetes/typed/storage/v1 - kubernetes/typed/storage/v1beta1 - pkg/api - pkg/api/errors - pkg/api/install - pkg/api/meta - - pkg/api/resource - pkg/api/unversioned - pkg/api/v1 - - pkg/api/validation/path - - pkg/apimachinery - - pkg/apimachinery/announced - - pkg/apimachinery/registered - pkg/apis/apps - pkg/apis/apps/install - pkg/apis/apps/v1beta1 - pkg/apis/authentication - pkg/apis/authentication/install + - pkg/apis/authentication/v1 - pkg/apis/authentication/v1beta1 - pkg/apis/authorization - pkg/apis/authorization/install + - pkg/apis/authorization/v1 - pkg/apis/authorization/v1beta1 - pkg/apis/autoscaling - pkg/apis/autoscaling/install - pkg/apis/autoscaling/v1 + - pkg/apis/autoscaling/v2alpha1 - pkg/apis/batch - pkg/apis/batch/install - pkg/apis/batch/v1 - pkg/apis/batch/v2alpha1 - pkg/apis/certificates - pkg/apis/certificates/install - - pkg/apis/certificates/v1alpha1 + - pkg/apis/certificates/v1beta1 - pkg/apis/extensions - pkg/apis/extensions/install - pkg/apis/extensions/v1beta1 - - pkg/apis/meta/v1 - - pkg/apis/meta/v1/unstructured - pkg/apis/policy - pkg/apis/policy/install - pkg/apis/policy/v1beta1 - pkg/apis/rbac - pkg/apis/rbac/install - pkg/apis/rbac/v1alpha1 + - pkg/apis/rbac/v1beta1 + - pkg/apis/settings + - pkg/apis/settings/install + - pkg/apis/settings/v1alpha1 - pkg/apis/storage - pkg/apis/storage/install + - pkg/apis/storage/v1 - pkg/apis/storage/v1beta1 - - pkg/auth/user - - pkg/conversion - - pkg/conversion/queryparams - pkg/fields - - pkg/genericapiserver/openapi/common - - pkg/labels - pkg/runtime - pkg/runtime/schema - pkg/runtime/serializer - - pkg/runtime/serializer/json - - pkg/runtime/serializer/protobuf - - pkg/runtime/serializer/recognizer - - pkg/runtime/serializer/streaming - - pkg/runtime/serializer/versioning - - pkg/selection - - pkg/third_party/forked/golang/reflect - - pkg/third_party/forked/golang/template - - pkg/types - pkg/util - - pkg/util/cert - - pkg/util/clock - - pkg/util/diff - - pkg/util/errors - - pkg/util/flowcontrol - - pkg/util/framer - - pkg/util/homedir - - pkg/util/integer - - pkg/util/intstr - - pkg/util/json - - pkg/util/jsonpath - - pkg/util/labels - - pkg/util/net - pkg/util/parsers - - pkg/util/rand - - pkg/util/runtime - - pkg/util/sets - - pkg/util/uuid - - pkg/util/validation - - pkg/util/validation/field - pkg/util/wait - - pkg/util/yaml - pkg/version - pkg/watch - - pkg/watch/versioned - - plugin/pkg/client/auth - - plugin/pkg/client/auth/gcp - - plugin/pkg/client/auth/oidc - rest + - rest/watch - tools/auth - tools/cache - tools/clientcmd @@ -400,39 +363,9 @@ imports: - tools/clientcmd/api/v1 - tools/metrics - transport -testImports: -- name: github.com/onsi/ginkgo - version: 00054c0bb96fc880d4e0be1b90937fad438c5290 - subpackages: - - config - - internal/codelocation - - internal/containernode - - internal/failer - - internal/leafnodes - - internal/remote - - internal/spec - - internal/specrunner - - internal/suite - - internal/testingtproxy - - internal/writer - - reporters - - reporters/stenographer - - reporters/stenographer/support/go-colorable - - reporters/stenographer/support/go-isatty - - types -- name: github.com/onsi/gomega - version: f1f0f388b31eca4e2cbe7a6dd8a3a1dfddda5b1c - subpackages: - - format - - gbytes - - gexec - - internal/assertion - - internal/asyncassertion - - internal/oraclematcher - - internal/testingtsupport - - matchers - - matchers/support/goraph/bipartitegraph - - matchers/support/goraph/edge - - matchers/support/goraph/node - - matchers/support/goraph/util - - types + - util/cert + - util/clock + - util/flowcontrol + - util/homedir + - util/integer +testImports: [] diff --git a/glide.yaml b/glide.yaml index cf610f6..9a9c0c5 100644 --- a/glide.yaml +++ b/glide.yaml @@ -11,7 +11,7 @@ import: - network - package: github.com/pkg/errors - package: github.com/projectcalico/libcalico-go - version: v1.1.1 + version: ^1.5.0 subpackages: - lib/api - lib/client diff --git a/tests/custom_if_prefix/libnetwork_env_var_test.go b/tests/custom_if_prefix/libnetwork_env_var_test.go index 31e610d..75b6111 100644 --- a/tests/custom_if_prefix/libnetwork_env_var_test.go +++ b/tests/custom_if_prefix/libnetwork_env_var_test.go @@ -35,7 +35,7 @@ var _ = Describe("Running plugin with custom ENV", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, + `{"state":"active","name":"%s","active_instance_id": "","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, interface_name, mac, name, ip))) // Check profile diff --git a/tests/custom_wep_labelling/libnetwork_env_var_test.go b/tests/custom_wep_labelling/libnetwork_env_var_test.go index 0c1de79..9d111e6 100644 --- a/tests/custom_wep_labelling/libnetwork_env_var_test.go +++ b/tests/custom_wep_labelling/libnetwork_env_var_test.go @@ -39,7 +39,7 @@ var _ = Describe("Running plugin with custom ENV", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[],"labels":{"baz":"quux","foo": "bar"}}`, + `{"state":"active","name":"%s","active_instance_id":"","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[],"labels":{"baz":"quux","foo": "bar"}}`, interface_name, mac, name, ip))) // Check profile @@ -83,7 +83,7 @@ var _ = Describe("Running plugin with custom ENV", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":null,"ipv4_nets":["%s/32"],"ipv6_nets":[],"labels":{"baz":"quux","foo": "bar"}}`, + `{"state":"active","name":"%s","active_instance_id":"","mac":"%s","profile_ids":null,"ipv4_nets":["%s/32"],"ipv6_nets":[],"labels":{"baz":"quux","foo": "bar"}}`, interface_name, mac, ip))) // Delete container diff --git a/tests/default_environment/libnetwork_test.go b/tests/default_environment/libnetwork_test.go index 17cef61..0874d7e 100644 --- a/tests/default_environment/libnetwork_test.go +++ b/tests/default_environment/libnetwork_test.go @@ -152,7 +152,7 @@ var _ = Describe("Libnetwork Tests", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, + `{"state":"active","name":"%s","active_instance_id":"","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, interface_name, mac, name, ip))) // Check profile @@ -197,7 +197,7 @@ var _ = Describe("Libnetwork Tests", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, + `{"state":"active","name":"%s","active_instance_id":"","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, interface_name, mac, name, ip))) // Check the interface exists on the Host - it has an autoassigned @@ -248,7 +248,7 @@ var _ = Describe("Libnetwork Tests", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, + `{"state":"active","name":"%s","active_instance_id":"","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, interface_name_subnet, mac, name_subnet, ip))) // Check the interface exists on the Host - it has an autoassigned @@ -283,7 +283,7 @@ var _ = Describe("Libnetwork Tests", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, + `{"state":"active","name":"%s","active_instance_id":"","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":[]}`, interface_name, mac, name, ip))) // Delete container @@ -317,7 +317,7 @@ var _ = Describe("Libnetwork Tests", func() { // Check that the endpoint is created in etcd etcd_endpoint := GetEtcdString(fmt.Sprintf("/calico/v1/host/test/workload/libnetwork/libnetwork/endpoint/%s", endpoint_id)) Expect(etcd_endpoint).Should(MatchJSON(fmt.Sprintf( - `{"state":"active","name":"%s","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":["%s/128"]}`, + `{"state":"active","name":"%s","active_instance_id":"","mac":"%s","profile_ids":["%s"],"ipv4_nets":["%s/32"],"ipv6_nets":["%s/128"]}`, interface_name, mac, name, ip, ipv6))) // Check the interface exists on the Host - it has an autoassigned From 52b5902b5208ac79b0ee5b171d15b3cde96a4d93 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 31 Jul 2017 09:46:27 -0700 Subject: [PATCH 15/18] Update the import for logrus to use the updated username --- driver/ipam_driver.go | 2 +- driver/network_driver.go | 2 +- glide.lock | 64 +++++++++++++++++++++++++++------------- glide.yaml | 4 +-- main.go | 2 +- utils/log/log.go | 2 +- utils/netns/netns.go | 2 +- 7 files changed, 50 insertions(+), 28 deletions(-) diff --git a/driver/ipam_driver.go b/driver/ipam_driver.go index 3fc6516..3867264 100644 --- a/driver/ipam_driver.go +++ b/driver/ipam_driver.go @@ -4,8 +4,8 @@ import ( "fmt" "net" - log "github.com/Sirupsen/logrus" "github.com/pkg/errors" + log "github.com/sirupsen/logrus" "github.com/docker/go-plugins-helpers/ipam" "github.com/projectcalico/libcalico-go/lib/api" diff --git a/driver/network_driver.go b/driver/network_driver.go index af950c8..f3e565f 100644 --- a/driver/network_driver.go +++ b/driver/network_driver.go @@ -9,9 +9,9 @@ import ( "strings" "time" - log "github.com/Sirupsen/logrus" "github.com/pkg/errors" libcalicoErrors "github.com/projectcalico/libcalico-go/lib/errors" + log "github.com/sirupsen/logrus" dockerClient "github.com/docker/docker/client" "github.com/docker/go-plugins-helpers/network" diff --git a/glide.lock b/glide.lock index 039cc90..6a9134f 100644 --- a/glide.lock +++ b/glide.lock @@ -1,19 +1,27 @@ -hash: cd18acbde6b160f9405bdf2df246fc6c763536a58e331c73e7f86763b034d97a -updated: 2017-07-24T19:05:58.33834663Z +hash: f1b87069fa5857ab2fc2efc0847354e40357af64e9b84dea0daeae59884ad6c9 +updated: 2017-07-31T15:25:24.514237992-07:00 imports: - name: github.com/coreos/etcd - version: 17ae440991da3bdb2df4309936dd2074f66ec394 + version: c31bec0f29facff13f7c3e3d948e55dd6689ed42 subpackages: - client - pkg/pathutil + - pkg/srv - pkg/tlsutil - pkg/transport - pkg/types - version - name: github.com/coreos/go-semver - version: 568e959cd89871e61434c1143528d9162da89ef2 + version: 8ab6407b697782a06568d4b7f1db25550ec2e4c6 subpackages: - semver +- name: github.com/coreos/go-systemd + version: 48702e0da86bd25e76cfef347e2adeb434a0d0a6 + subpackages: + - activation + - daemon + - journal + - util - name: github.com/davecgh/go-spew version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d subpackages: @@ -43,26 +51,26 @@ imports: - client - pkg/tlsconfig - name: github.com/docker/go-connections - version: eb315e36415380e7c2fdee175262560ff42359da + version: 3ede32e2033de7505e6500d6c868c2b9ed9f169d subpackages: - nat - sockets - tlsconfig - name: github.com/docker/go-plugins-helpers - version: 261c0c7fc902aeb7ad448df38e6ee370a3e0e597 + version: 96217206cc52dcc41d4ace9a9bef8c6111f2e5f9 subpackages: - ipam - network - sdk - name: github.com/docker/go-units - version: e30f1e79f3cd72542f2026ceec18d3bd67ab859c + version: 0dadbb0345b35ec7ef35e228dabb8de89a65bf52 - name: github.com/emicklei/go-restful version: 09691a3b6378b740595c1002f40c34dd5f218a22 subpackages: - log - swagger - name: github.com/ghodss/yaml - version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee + version: 0ca9ea5df5451ffdf184b4428c902747c2c11cd7 - name: github.com/go-openapi/jsonpointer version: 46af16f9f7b149af66e5d1bd010e3574dc06de98 - name: github.com/go-openapi/jsonreference @@ -87,7 +95,7 @@ imports: - name: github.com/juju/ratelimit version: 77ed1c8a01217656d2080ad51981f6e99adaa177 - name: github.com/kelseyhightower/envconfig - version: 8bf4bbfc795e2c7c8a5ea47b707453ed019e2ad4 + version: f611eb38b3875cc3bd991ca91c51d06446afa14c - name: github.com/mailru/easyjson version: d5b7844b561a7bc640052f1b935f7b800330d7e0 subpackages: @@ -95,7 +103,7 @@ imports: - jlexer - jwriter - name: github.com/Microsoft/go-winio - version: 24a3e3d3fc7451805e09d11e11e95d9a0a4f205e + version: 7ff89941bcb93df2e962467fb073c6e997b13cf0 - name: github.com/onsi/ginkgo version: f40a49d81e5c12e90400620b6242fb29a8e7c9d9 subpackages: @@ -117,7 +125,7 @@ imports: - reporters/stenographer/support/go-isatty - types - name: github.com/onsi/gomega - version: 9b8c753e8dfb382618ba8fa19b4197b5dcb0434c + version: c893efa28eb45626cdaa76c9f653b62488858837 subpackages: - format - gbytes @@ -133,7 +141,7 @@ imports: - matchers/support/goraph/util - types - name: github.com/pkg/errors - version: 248dadf4e9068a0b3e79f02ed0a610d935de5302 + version: c605e284fe17294bda444b34710735b29d1a9d90 - name: github.com/projectcalico/go-json version: 6219dc7339ba20ee4c57df0a8baac62317d19cb1 subpackages: @@ -143,7 +151,7 @@ imports: - name: github.com/projectcalico/go-yaml-wrapper version: 598e54215bee41a19677faa4f0c32acd2a87eb56 - name: github.com/projectcalico/libcalico-go - version: e1ab5e5bf4a57ea6fa71bf4a7712af27b824a005 + version: 93f9e49214a678551648eb9c28ce57bc286a3169 subpackages: - lib/api - lib/api/unversioned @@ -173,8 +181,8 @@ imports: - name: github.com/PuerkitoBio/urlesc version: 5bd2802263f21d8788851d5305584c82a5c75d7e - name: github.com/satori/go.uuid - version: b061729afc07e77a8aa4fad0a2fd840958f1942a -- name: github.com/Sirupsen/logrus + version: 879c5887cd475cd7864858769793b2ceb0d44feb +- name: github.com/sirupsen/logrus version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f - name: github.com/spf13/pflag version: 08b1a584251b5b62f458943640fc8ebd4d50aaa5 @@ -183,11 +191,11 @@ imports: subpackages: - codec - name: github.com/vishvananda/netlink - version: fe3b5664d23a11b52ba59bece4ff29c52772a56b + version: 8d7f7aad193e778023f06a843a26ffc9615ca840 subpackages: - nl - name: github.com/vishvananda/netns - version: 54f0e4339ce73702a0607f49922aaa1e749b418d + version: 86bef332bfc3b59b7624a600bd53009ce91a9829 - name: golang.org/x/crypto version: 1351f936d976c60a0a48d728281922cf63eafb8d subpackages: @@ -195,17 +203,20 @@ imports: - blowfish - ssh/terminal - name: golang.org/x/net - version: f2499483f923065a842d38eb4c7f1927e6fc6e6d + version: c8c74377599bd978aee1cf3b9b63a8634051cec2 subpackages: - context - context/ctxhttp + - html + - html/atom + - html/charset - http2 - http2/hpack - idna - lex/httplex - proxy - name: golang.org/x/sys - version: 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9 + version: e48874b42435b4347fc52bdee0424a52abc974d7 subpackages: - unix - windows @@ -213,8 +224,19 @@ imports: version: 19e51611da83d6be54ddafce4a4af510cb3e9ea4 subpackages: - cases + - encoding + - encoding/charmap + - encoding/htmlindex + - encoding/internal + - encoding/internal/identifier + - encoding/japanese + - encoding/korean + - encoding/simplifiedchinese + - encoding/traditionalchinese + - encoding/unicode - internal - internal/tag + - internal/utf8internal - language - runes - secure/bidirule @@ -224,7 +246,7 @@ imports: - unicode/norm - width - name: gopkg.in/go-playground/validator.v8 - version: 5f57d2222ad794d0dffb07e664ea05e2ee07d60c + version: 5f1438d3fca68893a817e4a66806cea46a9e4ebf - name: gopkg.in/inf.v0 version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 - name: gopkg.in/tchap/go-patricia.v2 @@ -232,7 +254,7 @@ imports: subpackages: - patricia - name: gopkg.in/yaml.v2 - version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 + version: cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b - name: k8s.io/apimachinery version: b317fa7ec8e0e7d1f77ac63bf8c3ec7b29a2a215 subpackages: diff --git a/glide.yaml b/glide.yaml index 9a9c0c5..a0460fb 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,6 @@ package: github.com/projectcalico/libnetwork-plugin import: -- package: github.com/Sirupsen/logrus +- package: github.com/sirupsen/logrus - package: github.com/docker/docker version: v17.03.0-ce subpackages: @@ -11,7 +11,7 @@ import: - network - package: github.com/pkg/errors - package: github.com/projectcalico/libcalico-go - version: ^1.5.0 + version: 93f9e49214a678551648eb9c28ce57bc286a3169 subpackages: - lib/api - lib/client diff --git a/main.go b/main.go index c550daa..eb9f4c9 100644 --- a/main.go +++ b/main.go @@ -3,11 +3,11 @@ package main import ( "os" - log "github.com/Sirupsen/logrus" "github.com/docker/go-plugins-helpers/ipam" "github.com/docker/go-plugins-helpers/network" "github.com/projectcalico/libcalico-go/lib/api" "github.com/projectcalico/libnetwork-plugin/driver" + log "github.com/sirupsen/logrus" "flag" diff --git a/utils/log/log.go b/utils/log/log.go index 8f3e420..13c0586 100644 --- a/utils/log/log.go +++ b/utils/log/log.go @@ -3,7 +3,7 @@ package log import ( "encoding/json" - logger "github.com/Sirupsen/logrus" + logger "github.com/sirupsen/logrus" ) func JSONMessage(formattedMessage string, data interface{}) { diff --git a/utils/netns/netns.go b/utils/netns/netns.go index 26a3bf4..55ae5ee 100644 --- a/utils/netns/netns.go +++ b/utils/netns/netns.go @@ -5,7 +5,7 @@ import ( "net" "syscall" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/pkg/errors" "github.com/vishvananda/netlink" From f3611c2779c9745fcfd01ef0e6875be31f7f8ce5 Mon Sep 17 00:00:00 2001 From: "David J. Wilder" Date: Mon, 16 Oct 2017 11:31:29 -0700 Subject: [PATCH 16/18] Enable ipv6 in the dind test container. Fix for issue #162. Signed-off-by: David Wilder --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index bba50ff..efd50a6 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,7 @@ run-plugin: run-etcd dist/libnetwork-plugin -v $(PLUGIN_LOCATION):/libnetwork-plugin \ docker:$(DOCKER_VERSION) --cluster-store=etcd://$(LOCAL_IP_ENV):2379 # View the logs by running 'docker exec dind cat plugin.log' + docker exec -tid --privileged dind sh -c 'sysctl -w net.ipv6.conf.default.disable_ipv6=0' docker exec -tid --privileged dind sh -c '/libnetwork-plugin 2>>/plugin.log' # To speak to this docker: # export DOCKER_HOST=localhost:5375 From 6e7d677951dc206defd563e5281373935783b89f Mon Sep 17 00:00:00 2001 From: Brendan Creane Date: Tue, 21 Nov 2017 16:07:19 -0800 Subject: [PATCH 17/18] update for libcalico-go v1.7.2; rev go-build --- Makefile | 8 +++-- glide.lock | 95 ++++++++++++++++++++++++++++++++++++++++++------------ glide.yaml | 24 +++++++------- 3 files changed, 92 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index efd50a6..7ac0a77 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ # considerably. .SUFFIXES: +GO_BUILD_VER?=v0.9 + SRC_FILES=$(shell find . -type f -name '*.go') # These variables can be overridden by setting an environment variable. @@ -11,7 +13,7 @@ LOCAL_IP_ENV?=$(shell ip route get 8.8.8.8 | head -1 | awk '{print $$7}') DOCKER_VERSION?=dind HOST_CHECKOUT_DIR?=$(CURDIR) CONTAINER_NAME?=calico/libnetwork-plugin -CALICO_BUILD?=calico/go-build +GO_BUILD_CONTAINER?=calico/go-build:$(GO_BUILD_VER) PLUGIN_LOCATION?=$(CURDIR)/dist/libnetwork-plugin DOCKER_BINARY_CONTAINER?=docker-binary-container @@ -29,7 +31,7 @@ vendor: glide.yaml -v $(CURDIR):/go/src/github.com/projectcalico/libnetwork-plugin:rw \ -v $(HOME)/.glide:/home/user/.glide:rw \ -e LOCAL_USER_ID=$(LOCAL_USER_ID) \ - $(CALICO_BUILD) /bin/sh -c ' \ + $(GO_BUILD_CONTAINER) /bin/sh -c ' \ cd /go/src/github.com/projectcalico/libnetwork-plugin && \ glide install -strip-vendor' @@ -45,7 +47,7 @@ dist/libnetwork-plugin: vendor -v $(CURDIR)/dist:/go/src/github.com/projectcalico/libnetwork-plugin/dist \ -v $(CURDIR)/.go-pkg-cache:/go/pkg/:rw \ -e LOCAL_USER_ID=$(LOCAL_USER_ID) \ - $(CALICO_BUILD) sh -c '\ + $(GO_BUILD_CONTAINER) sh -c '\ cd /go/src/github.com/projectcalico/libnetwork-plugin && \ make build' diff --git a/glide.lock b/glide.lock index 6a9134f..806bfd7 100644 --- a/glide.lock +++ b/glide.lock @@ -1,18 +1,25 @@ -hash: f1b87069fa5857ab2fc2efc0847354e40357af64e9b84dea0daeae59884ad6c9 -updated: 2017-07-31T15:25:24.514237992-07:00 +hash: d7d49ac6b7387ddc5e626bdd471ef75314e33285ff86e45adb847ed61e40def8 +updated: 2017-11-21T16:05:33.286729077-08:00 imports: - name: github.com/coreos/etcd - version: c31bec0f29facff13f7c3e3d948e55dd6689ed42 + version: 17ae440991da3bdb2df4309936dd2074f66ec394 subpackages: - client - pkg/pathutil - - pkg/srv - pkg/tlsutil - pkg/transport - pkg/types - version +- name: github.com/coreos/go-oidc + version: be73733bb8cc830d0205609b95d125215f8e9c70 + subpackages: + - http + - jose + - key + - oauth2 + - oidc - name: github.com/coreos/go-semver - version: 8ab6407b697782a06568d4b7f1db25550ec2e4c6 + version: 568e959cd89871e61434c1143528d9162da89ef2 subpackages: - semver - name: github.com/coreos/go-systemd @@ -22,6 +29,13 @@ imports: - daemon - journal - util +- name: github.com/coreos/pkg + version: 3ac0863d7acf3bc44daf49afef8919af12f704ef + subpackages: + - capnslog + - health + - httputil + - timeutil - name: github.com/davecgh/go-spew version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d subpackages: @@ -32,7 +46,7 @@ imports: - digest - reference - name: github.com/docker/docker - version: 60ccb2265b0574d6c1c1090876a1d1ab32bed60e + version: f5ec1e2936dcbe7b5001c2b817188b095c700c27 subpackages: - api/types - api/types/blkiodev @@ -57,7 +71,7 @@ imports: - sockets - tlsconfig - name: github.com/docker/go-plugins-helpers - version: 96217206cc52dcc41d4ace9a9bef8c6111f2e5f9 + version: bd8c600f0cdd76c7a57ff6aa86bd2b423868c688 subpackages: - ipam - network @@ -65,12 +79,12 @@ imports: - name: github.com/docker/go-units version: 0dadbb0345b35ec7ef35e228dabb8de89a65bf52 - name: github.com/emicklei/go-restful - version: 09691a3b6378b740595c1002f40c34dd5f218a22 + version: 777bb3f19bcafe2575ffb2a3e46af92509ae9594 subpackages: - log - swagger - name: github.com/ghodss/yaml - version: 0ca9ea5df5451ffdf184b4428c902747c2c11cd7 + version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee - name: github.com/go-openapi/jsonpointer version: 46af16f9f7b149af66e5d1bd010e3574dc06de98 - name: github.com/go-openapi/jsonreference @@ -86,16 +100,23 @@ imports: - sortkeys - name: github.com/golang/glog version: 44145f04b68cf362d9c4df2182967c2275eaefed +- name: github.com/golang/protobuf + version: 4bd1920723d7b7c925de087aa32e2187708897f7 + subpackages: + - jsonpb + - proto - name: github.com/google/gofuzz version: 44d81051d367757e1c7c6a5a86423ece9afcf63c - name: github.com/howeyc/gopass version: 3ca23474a7c7203e0a0a070fd33508f6efdb9b3d - name: github.com/imdario/mergo version: 6633656539c1639d9d78127b7d47c622b5d7b6dc +- name: github.com/jonboulle/clockwork + version: 2eee05ed794112d45db504eb05aa693efd2b8b09 - name: github.com/juju/ratelimit version: 77ed1c8a01217656d2080ad51981f6e99adaa177 - name: github.com/kelseyhightower/envconfig - version: f611eb38b3875cc3bd991ca91c51d06446afa14c + version: 91921eb4cf999321cdbeebdba5a03555800d493b - name: github.com/mailru/easyjson version: d5b7844b561a7bc640052f1b935f7b800330d7e0 subpackages: @@ -103,7 +124,7 @@ imports: - jlexer - jwriter - name: github.com/Microsoft/go-winio - version: 7ff89941bcb93df2e962467fb073c6e997b13cf0 + version: 78439966b38d69bf38227fbf57ac8a6fee70f69a - name: github.com/onsi/ginkgo version: f40a49d81e5c12e90400620b6242fb29a8e7c9d9 subpackages: @@ -141,7 +162,7 @@ imports: - matchers/support/goraph/util - types - name: github.com/pkg/errors - version: c605e284fe17294bda444b34710735b29d1a9d90 + version: f15c970de5b76fac0b59abb32d62c17cc7bed265 - name: github.com/projectcalico/go-json version: 6219dc7339ba20ee4c57df0a8baac62317d19cb1 subpackages: @@ -151,7 +172,7 @@ imports: - name: github.com/projectcalico/go-yaml-wrapper version: 598e54215bee41a19677faa4f0c32acd2a87eb56 - name: github.com/projectcalico/libcalico-go - version: 93f9e49214a678551648eb9c28ce57bc286a3169 + version: 119c3c82c1c22337ceaffea0cdca5b127a139a1d subpackages: - lib/api - lib/api/unversioned @@ -159,9 +180,10 @@ imports: - lib/backend/api - lib/backend/compat - lib/backend/etcd + - lib/backend/extensions - lib/backend/k8s + - lib/backend/k8s/custom - lib/backend/k8s/resources - - lib/backend/k8s/thirdparty - lib/backend/model - lib/client - lib/converter @@ -181,7 +203,7 @@ imports: - name: github.com/PuerkitoBio/urlesc version: 5bd2802263f21d8788851d5305584c82a5c75d7e - name: github.com/satori/go.uuid - version: 879c5887cd475cd7864858769793b2ceb0d44feb + version: b061729afc07e77a8aa4fad0a2fd840958f1942a - name: github.com/sirupsen/logrus version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f - name: github.com/spf13/pflag @@ -191,11 +213,11 @@ imports: subpackages: - codec - name: github.com/vishvananda/netlink - version: 8d7f7aad193e778023f06a843a26ffc9615ca840 + version: c2a3de3b38bd00f07290c3c5e12b4dbc04ec8666 subpackages: - nl - name: github.com/vishvananda/netns - version: 86bef332bfc3b59b7624a600bd53009ce91a9829 + version: be1fbeda19366dea804f00efff2dd73a1642fdcc - name: golang.org/x/crypto version: 1351f936d976c60a0a48d728281922cf63eafb8d subpackages: @@ -203,7 +225,7 @@ imports: - blowfish - ssh/terminal - name: golang.org/x/net - version: c8c74377599bd978aee1cf3b9b63a8634051cec2 + version: f2499483f923065a842d38eb4c7f1927e6fc6e6d subpackages: - context - context/ctxhttp @@ -215,8 +237,15 @@ imports: - idna - lex/httplex - proxy +- name: golang.org/x/oauth2 + version: 045497edb6234273d67dbc25da3f2ddbc4c4cacf + subpackages: + - google + - internal + - jws + - jwt - name: golang.org/x/sys - version: e48874b42435b4347fc52bdee0424a52abc974d7 + version: 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9 subpackages: - unix - windows @@ -245,8 +274,27 @@ imports: - unicode/bidi - unicode/norm - width +- name: google.golang.org/appengine + version: 12d5545dc1cfa6047a286d5e853841b6471f4c19 + subpackages: + - internal + - internal/app_identity + - internal/base + - internal/datastore + - internal/log + - internal/modules + - internal/remote_api + - internal/urlfetch + - urlfetch +- name: google.golang.org/cloud + version: 975617b05ea8a58727e6c1a06b6161ff4185a9f2 + subpackages: + - compute/metadata + - internal + - internal/opts + - storage - name: gopkg.in/go-playground/validator.v8 - version: 5f1438d3fca68893a817e4a66806cea46a9e4ebf + version: 5f57d2222ad794d0dffb07e664ea05e2ee07d60c - name: gopkg.in/inf.v0 version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 - name: gopkg.in/tchap/go-patricia.v2 @@ -254,7 +302,7 @@ imports: subpackages: - patricia - name: gopkg.in/yaml.v2 - version: cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b + version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 - name: k8s.io/apimachinery version: b317fa7ec8e0e7d1f77ac63bf8c3ec7b29a2a215 subpackages: @@ -375,8 +423,12 @@ imports: - pkg/util/wait - pkg/version - pkg/watch + - plugin/pkg/client/auth + - plugin/pkg/client/auth/gcp + - plugin/pkg/client/auth/oidc - rest - rest/watch + - third_party/forked/golang/template - tools/auth - tools/cache - tools/clientcmd @@ -390,4 +442,5 @@ imports: - util/flowcontrol - util/homedir - util/integer + - util/jsonpath testImports: [] diff --git a/glide.yaml b/glide.yaml index a0460fb..bbbb5b5 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,8 +1,19 @@ package: github.com/projectcalico/libnetwork-plugin import: +- package: github.com/projectcalico/libcalico-go + version: 119c3c82c1c22337ceaffea0cdca5b127a139a1d +- package: github.com/coreos/etcd + version: 17ae440991da3bdb2df4309936dd2074f66ec394 +- package: github.com/ugorji/go + version: ded73eae5db7e7a0ef6f55aace87a2873c5d2b74 + subpackages: + - codec +- package: github.com/emicklei/go-restful + version: v1.2 - package: github.com/sirupsen/logrus + version: ^0.10.0 - package: github.com/docker/docker - version: v17.03.0-ce + version: v17.03.2-ce subpackages: - client - package: github.com/docker/go-plugins-helpers @@ -10,18 +21,9 @@ import: - ipam - network - package: github.com/pkg/errors -- package: github.com/projectcalico/libcalico-go - version: 93f9e49214a678551648eb9c28ce57bc286a3169 - subpackages: - - lib/api - - lib/client - - lib/errors - - lib/net - package: github.com/vishvananda/netlink + testImport: -- package: github.com/coreos/etcd - subpackages: - - client - package: github.com/onsi/ginkgo - package: github.com/onsi/gomega subpackages: From 0086d7a133128e9a32f2155db6a224ff2140f632 Mon Sep 17 00:00:00 2001 From: Erik Stidham Date: Wed, 22 Nov 2017 16:08:47 -0600 Subject: [PATCH 18/18] Updating pins --- driver/network_driver.go | 5 ++- glide.lock | 80 ++++++++++++++++------------------------ glide.yaml | 10 ++++- 3 files changed, 44 insertions(+), 51 deletions(-) diff --git a/driver/network_driver.go b/driver/network_driver.go index f3e565f..4477ffb 100644 --- a/driver/network_driver.go +++ b/driver/network_driver.go @@ -13,6 +13,7 @@ import ( libcalicoErrors "github.com/projectcalico/libcalico-go/lib/errors" log "github.com/sirupsen/logrus" + dockerTypes "github.com/docker/docker/api/types" dockerClient "github.com/docker/docker/client" "github.com/docker/go-plugins-helpers/network" "github.com/projectcalico/libcalico-go/lib/api" @@ -270,7 +271,7 @@ func (d NetworkDriver) CreateEndpoint(request *network.CreateEndpointRequest) (* return nil, err } defer dockerCli.Close() - networkData, err := dockerCli.NetworkInspect(context.Background(), request.NetworkID) + networkData, err := dockerCli.NetworkInspect(context.Background(), request.NetworkID, dockerTypes.NetworkInspectOptions{}) if err != nil { err = errors.Wrapf(err, "Network %v inspection error", request.NetworkID) log.Errorln(err) @@ -485,7 +486,7 @@ RETRY_NETWORK_INSPECT: } // inspect our custom network - networkData, err := dockerCli.NetworkInspect(context.Background(), networkID) + networkData, err := dockerCli.NetworkInspect(context.Background(), networkID, dockerTypes.NetworkInspectOptions{}) if err != nil { err = errors.Wrapf(err, "Error inspecting network %s - retrying (T=%s)", networkID, time.Since(start)) log.Warningln(err) diff --git a/glide.lock b/glide.lock index 806bfd7..5f7ab8e 100644 --- a/glide.lock +++ b/glide.lock @@ -1,6 +1,11 @@ -hash: d7d49ac6b7387ddc5e626bdd471ef75314e33285ff86e45adb847ed61e40def8 -updated: 2017-11-21T16:05:33.286729077-08:00 +hash: 0fb309483330df9bcfae77226a7d39bb3f623a051d962d0b89825c4e8b114b20 +updated: 2017-11-22T16:00:46.814284666-06:00 imports: +- name: cloud.google.com/go + version: 3b1ae45394a234c385be014e9a488f2bb6eef821 + subpackages: + - compute/metadata + - internal - name: github.com/coreos/etcd version: 17ae440991da3bdb2df4309936dd2074f66ec394 subpackages: @@ -22,13 +27,6 @@ imports: version: 568e959cd89871e61434c1143528d9162da89ef2 subpackages: - semver -- name: github.com/coreos/go-systemd - version: 48702e0da86bd25e76cfef347e2adeb434a0d0a6 - subpackages: - - activation - - daemon - - journal - - util - name: github.com/coreos/pkg version: 3ac0863d7acf3bc44daf49afef8919af12f704ef subpackages: @@ -41,29 +39,30 @@ imports: subpackages: - spew - name: github.com/docker/distribution - version: cd27f179f2c10c5d300e6d09025b538c475b0d51 + version: e5b5e44386f7964a1f010a2b8b7687d073215bbb subpackages: - - digest + - digestset - reference - name: github.com/docker/docker - version: f5ec1e2936dcbe7b5001c2b817188b095c700c27 + version: d032264e1365a1cea621b7105e1ca521cb4218ef subpackages: + - api - api/types - api/types/blkiodev - api/types/container - api/types/events - api/types/filters + - api/types/image - api/types/mount - api/types/network - - api/types/reference - api/types/registry - api/types/strslice - api/types/swarm + - api/types/swarm/runtime - api/types/time - api/types/versions - api/types/volume - client - - pkg/tlsconfig - name: github.com/docker/go-connections version: 3ede32e2033de7505e6500d6c868c2b9ed9f169d subpackages: @@ -71,13 +70,13 @@ imports: - sockets - tlsconfig - name: github.com/docker/go-plugins-helpers - version: bd8c600f0cdd76c7a57ff6aa86bd2b423868c688 + version: 261c0c7fc902aeb7ad448df38e6ee370a3e0e597 subpackages: - ipam - network - sdk - name: github.com/docker/go-units - version: 0dadbb0345b35ec7ef35e228dabb8de89a65bf52 + version: e30f1e79f3cd72542f2026ceec18d3bd67ab859c - name: github.com/emicklei/go-restful version: 777bb3f19bcafe2575ffb2a3e46af92509ae9594 subpackages: @@ -116,7 +115,7 @@ imports: - name: github.com/juju/ratelimit version: 77ed1c8a01217656d2080ad51981f6e99adaa177 - name: github.com/kelseyhightower/envconfig - version: 91921eb4cf999321cdbeebdba5a03555800d493b + version: 5c008110b20b657eb7e005b83d0a5f6aa6bb5f4b - name: github.com/mailru/easyjson version: d5b7844b561a7bc640052f1b935f7b800330d7e0 subpackages: @@ -124,9 +123,9 @@ imports: - jlexer - jwriter - name: github.com/Microsoft/go-winio - version: 78439966b38d69bf38227fbf57ac8a6fee70f69a + version: 24a3e3d3fc7451805e09d11e11e95d9a0a4f205e - name: github.com/onsi/ginkgo - version: f40a49d81e5c12e90400620b6242fb29a8e7c9d9 + version: 00054c0bb96fc880d4e0be1b90937fad438c5290 subpackages: - config - internal/codelocation @@ -135,7 +134,6 @@ imports: - internal/leafnodes - internal/remote - internal/spec - - internal/spec_iterator - internal/specrunner - internal/suite - internal/testingtproxy @@ -146,7 +144,7 @@ imports: - reporters/stenographer/support/go-isatty - types - name: github.com/onsi/gomega - version: c893efa28eb45626cdaa76c9f653b62488858837 + version: f1f0f388b31eca4e2cbe7a6dd8a3a1dfddda5b1c subpackages: - format - gbytes @@ -161,8 +159,15 @@ imports: - matchers/support/goraph/node - matchers/support/goraph/util - types +- name: github.com/opencontainers/go-digest + version: 279bed98673dd5bef374d3b6e4b09e2af76183bf +- name: github.com/opencontainers/image-spec + version: 89b51c794e9113108a2914e38e66c826a649f2b5 + subpackages: + - specs-go + - specs-go/v1 - name: github.com/pkg/errors - version: f15c970de5b76fac0b59abb32d62c17cc7bed265 + version: 248dadf4e9068a0b3e79f02ed0a610d935de5302 - name: github.com/projectcalico/go-json version: 6219dc7339ba20ee4c57df0a8baac62317d19cb1 subpackages: @@ -213,11 +218,11 @@ imports: subpackages: - codec - name: github.com/vishvananda/netlink - version: c2a3de3b38bd00f07290c3c5e12b4dbc04ec8666 + version: 05458f39209fe6d1610c1cb2ac4cdaa9a5b02e36 subpackages: - nl - name: github.com/vishvananda/netns - version: be1fbeda19366dea804f00efff2dd73a1642fdcc + version: 8ba1072b58e0c2a240eb5f6120165c7776c3e7b8 - name: golang.org/x/crypto version: 1351f936d976c60a0a48d728281922cf63eafb8d subpackages: @@ -229,16 +234,13 @@ imports: subpackages: - context - context/ctxhttp - - html - - html/atom - - html/charset - http2 - http2/hpack - idna - lex/httplex - proxy - name: golang.org/x/oauth2 - version: 045497edb6234273d67dbc25da3f2ddbc4c4cacf + version: 3c3a985cb79f52a3190fbc056984415ca6763d01 subpackages: - google - internal @@ -253,19 +255,8 @@ imports: version: 19e51611da83d6be54ddafce4a4af510cb3e9ea4 subpackages: - cases - - encoding - - encoding/charmap - - encoding/htmlindex - - encoding/internal - - encoding/internal/identifier - - encoding/japanese - - encoding/korean - - encoding/simplifiedchinese - - encoding/traditionalchinese - - encoding/unicode - internal - internal/tag - - internal/utf8internal - language - runes - secure/bidirule @@ -275,7 +266,7 @@ imports: - unicode/norm - width - name: google.golang.org/appengine - version: 12d5545dc1cfa6047a286d5e853841b6471f4c19 + version: 4f7eeb5305a4ba1966344836ba4af9996b7b4e05 subpackages: - internal - internal/app_identity @@ -286,15 +277,8 @@ imports: - internal/remote_api - internal/urlfetch - urlfetch -- name: google.golang.org/cloud - version: 975617b05ea8a58727e6c1a06b6161ff4185a9f2 - subpackages: - - compute/metadata - - internal - - internal/opts - - storage - name: gopkg.in/go-playground/validator.v8 - version: 5f57d2222ad794d0dffb07e664ea05e2ee07d60c + version: 5f1438d3fca68893a817e4a66806cea46a9e4ebf - name: gopkg.in/inf.v0 version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 - name: gopkg.in/tchap/go-patricia.v2 diff --git a/glide.yaml b/glide.yaml index bbbb5b5..93c7669 100644 --- a/glide.yaml +++ b/glide.yaml @@ -13,13 +13,21 @@ import: - package: github.com/sirupsen/logrus version: ^0.10.0 - package: github.com/docker/docker - version: v17.03.2-ce + version: d032264e1365a1cea621b7105e1ca521cb4218ef subpackages: - client + - api - package: github.com/docker/go-plugins-helpers + version: 261c0c7fc902aeb7ad448df38e6ee370a3e0e597 subpackages: - ipam - network +- package: github.com/docker/distribution + version: e5b5e44386f7964a1f010a2b8b7687d073215bbb + subpackages: + - reference +- package: github.com/docker/go-connections + version: v0.3.0 - package: github.com/pkg/errors - package: github.com/vishvananda/netlink