Skip to content

Commit

Permalink
Vendoring libnetwork v0.7.0-dev.5
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Boch <[email protected]>
  • Loading branch information
aboch committed Mar 9, 2016
1 parent 0771230 commit 5a65408
Show file tree
Hide file tree
Showing 47 changed files with 1,214 additions and 272 deletions.
4 changes: 2 additions & 2 deletions hack/vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ clone git github.com/RackSec/srslog 6eb773f331e46fbba8eecb8e794e635e75fc04de
clone git github.com/imdario/mergo 0.2.1

#get libnetwork packages
clone git github.com/docker/libnetwork v0.7.0-dev.3
clone git github.com/docker/libnetwork v0.7.0-dev.5
clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
clone git github.com/hashicorp/go-msgpack 71c2886f5a673a35f909803f38ece5810165097b
clone git github.com/hashicorp/memberlist 9a1e242e454d2443df330bdd51a436d5a9058fc4
clone git github.com/hashicorp/serf 7151adcef72687bf95f451a2e0ba15cb19412bf2
clone git github.com/docker/libkv c2aac5dbbaa5c872211edea7c0f32b3bd67e7410
clone git github.com/vishvananda/netns 604eaf189ee867d8c147fafc28def2394e878d25
clone git github.com/vishvananda/netlink bfd70f556483c008636b920dda142fdaa0d59ef9
clone git github.com/vishvananda/netlink 631962935bff4f3d20ff32a72e8944f6d2836a26
clone git github.com/BurntSushi/toml f706d00e3de6abe700c994cdd545a1a4915af060
clone git github.com/samuel/go-zookeeper d0e0d8e11f318e000a8cc434616d69e329edc374
clone git github.com/deckarep/golang-set ef32fa3046d9f249d399f98ebaf9be944430fd1d
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_network_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ func (s *DockerSuite) TestDockerNetworkInternalMode(c *check.C) {
c.Assert(waitRun("second"), check.IsNil)
out, _, err := dockerCmdWithError("exec", "first", "ping", "-W", "4", "-c", "1", "www.google.com")
c.Assert(err, check.NotNil)
c.Assert(out, checker.Contains, "100% packet loss")
c.Assert(out, checker.Contains, "ping: bad address")
_, _, err = dockerCmdWithError("exec", "second", "ping", "-c", "1", "first")
c.Assert(err, check.IsNil)
}
22 changes: 21 additions & 1 deletion vendor/src/github.com/docker/libnetwork/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.7.0-dev.5 (2016-03-08)
- Fixes https://github.com/docker/docker/issues/20847
- Fixes https://github.com/docker/docker/issues/20997
- Fixes issues unveiled by docker integ test over 0.7.0-dev.4

## 0.7.0-dev.4 (2016-03-07)
- Changed ownership of exposed ports and port-mapping options from Endpoint to Sandbox
- Implement DNS RR in the Docker embedded DNS server
- Fixes https://github.com/docker/libnetwork/issues/984 (multi container overlay veth leak)
- Libnetwork to program container's interface MAC address
- Fixed bug in iptables.Exists() logic
- Fixes https://github.com/docker/docker/issues/20694
- Source external DNS queries from container namespace
- Added inbuilt nil IPAM driver
- Windows drivers integration fixes
- Extract hostname from (hostname.domainname). Related to https://github.com/docker/docker/issues/14282
- Fixed race in sandbox statistics read
- Fixes https://github.com/docker/libnetwork/issues/892 (docker start fails when ipv6.disable=1)
- Fixed error message on bridge network creation conflict

## 0.7.0-dev.3 (2016-02-17)
- Fixes https://github.com/docker/docker/issues/20350
- Fixes https://github.com/docker/docker/issues/20145
Expand Down Expand Up @@ -90,7 +110,7 @@
- DEPRECATE service discovery from default bridge network
- Introduced new network UX
- Support for multiple networks in bridge driver
- Local persistance with boltdb
- Local persistence with boltdb

## 0.4.0 (2015-07-24)

Expand Down
6 changes: 6 additions & 0 deletions vendor/src/github.com/docker/libnetwork/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"mrjana",
"mavenugo",
"sanimej",
"chenchun",
]

[people]
Expand All @@ -37,6 +38,11 @@
Email = "[email protected]"
GitHub = "LK4D4"

[people.chenchun]
Name = "Chun Chen"
Email = "[email protected]"
GitHub = "chenchun"

[people.icecrime]
Name = "Arnaud Porterie"
Email = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion vendor/src/github.com/docker/libnetwork/bitseq/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (s *sequence) toByteArray() ([]byte, error) {
func (s *sequence) fromByteArray(data []byte) error {
l := len(data)
if l%12 != 0 {
return fmt.Errorf("cannot deserialize byte sequence of lenght %d (%v)", l, data)
return fmt.Errorf("cannot deserialize byte sequence of length %d (%v)", l, data)
}

p := s
Expand Down
2 changes: 1 addition & 1 deletion vendor/src/github.com/docker/libnetwork/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func New(cfgOptions ...config.Option) (NetworkController, error) {

if c.cfg != nil && c.cfg.Cluster.Watcher != nil {
if err := c.initDiscovery(c.cfg.Cluster.Watcher); err != nil {
// Failing to initalize discovery is a bad situation to be in.
// Failing to initialize discovery is a bad situation to be in.
// But it cannot fail creating the Controller
log.Errorf("Failed to Initialize Discovery : %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type DataStore interface {
DeleteObjectAtomic(kvObject KVObject) error
// DeleteTree deletes a record
DeleteTree(kvObject KVObject) error
// Watchable returns whether the store is watchable are not
// Watchable returns whether the store is watchable or not
Watchable() bool
// Watch for changes on a KVObject
Watch(kvObject KVObject, stopCh <-chan struct{}) (<-chan KVObject, error)
Expand Down
44 changes: 26 additions & 18 deletions vendor/src/github.com/docker/libnetwork/default_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package libnetwork
import (
"fmt"

"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/types"
)

Expand All @@ -28,15 +27,15 @@ var procGwNetwork = make(chan (bool), 1)
- its deleted when an endpoint with GW joins the container
*/

func (sb *sandbox) setupDefaultGW(srcEp *endpoint) error {
var createOptions []EndpointOption
c := srcEp.getNetwork().getController()
func (sb *sandbox) setupDefaultGW() error {

// check if the conitainer already has a GW endpoint
if ep := sb.getEndpointInGWNetwork(); ep != nil {
return nil
}

c := sb.controller

// Look for default gw network. In case of error (includes not found),
// retry and create it if needed in a serialized execution.
n, err := c.NetworkByName(libnGWNetwork)
Expand All @@ -46,19 +45,7 @@ func (sb *sandbox) setupDefaultGW(srcEp *endpoint) error {
}
}

if opt, ok := srcEp.generic[netlabel.PortMap]; ok {
if pb, ok := opt.([]types.PortBinding); ok {
createOptions = append(createOptions, CreateOptionPortMapping(pb))
}
}

if opt, ok := srcEp.generic[netlabel.ExposedPorts]; ok {
if exp, ok := opt.([]types.TransportPort); ok {
createOptions = append(createOptions, CreateOptionExposedPorts(exp))
}
}

createOptions = append(createOptions, CreateOptionAnonymous())
createOptions := []EndpointOption{CreateOptionAnonymous()}

eplen := gwEPlen
if len(sb.containerID) < gwEPlen {
Expand All @@ -74,16 +61,24 @@ func (sb *sandbox) setupDefaultGW(srcEp *endpoint) error {
if err := epLocal.sbJoin(sb); err != nil {
return fmt.Errorf("container %s: endpoint join on GW Network failed: %v", sb.containerID, err)
}

return nil
}

// If present, removes the endpoint connecting the sandbox to the default gw network.
// Unless it is the endpoint designated to provide the external connectivity.
// If the sandbox is being deleted, removes the endpoint unconditionally.
func (sb *sandbox) clearDefaultGW() error {
var ep *endpoint

if ep = sb.getEndpointInGWNetwork(); ep == nil {
return nil
}

if ep == sb.getGatewayEndpoint() && !sb.inDelete {
return nil
}

if err := ep.sbLeave(sb, false); err != nil {
return fmt.Errorf("container %s: endpoint leaving GW Network failed: %v", sb.containerID, err)
}
Expand All @@ -98,7 +93,7 @@ func (sb *sandbox) needDefaultGW() bool {

for _, ep := range sb.getConnectedEndpoints() {
if ep.endpointInGWNetwork() {
continue
return false
}
if ep.getNetwork().Type() == "null" || ep.getNetwork().Type() == "host" {
continue
Expand Down Expand Up @@ -165,3 +160,16 @@ func (c *controller) defaultGwNetwork() (Network, error) {
}
return n, err
}

// Returns the endpoint which is providing external connectivity to the sandbox
func (sb *sandbox) getGatewayEndpoint() *endpoint {
for _, ep := range sb.getConnectedEndpoints() {
if ep.getNetwork().Type() == "null" || ep.getNetwork().Type() == "host" {
continue
}
if len(ep.Gateway()) != 0 {
return ep
}
}
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type DiscoveryType int
const (
// NodeDiscovery represents Node join/leave events provided by discovery
NodeDiscovery = iota + 1
// DatastoreConfig represents a add/remove datastore event
// DatastoreConfig represents an add/remove datastore event
DatastoreConfig
)

Expand Down
12 changes: 10 additions & 2 deletions vendor/src/github.com/docker/libnetwork/driverapi/driverapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ type Driver interface {
// Leave method is invoked when a Sandbox detaches from an endpoint.
Leave(nid, eid string) error

// ProgramExternalConnectivity invokes the driver method which does the necessary
// programming to allow the external connectivity dictated by the passed options
ProgramExternalConnectivity(nid, eid string, options map[string]interface{}) error

// RevokeExternalConnectivity aks the driver to remove any external connectivity
// programming that was done so far
RevokeExternalConnectivity(nid, eid string) error

// Type returns the the type of this driver, the network type this driver manages
Type() string
}
Expand Down Expand Up @@ -88,8 +96,8 @@ type JoinInfo interface {
// SetGatewayIPv6 sets the default IPv6 gateway when a container joins the endpoint.
SetGatewayIPv6(net.IP) error

// AddStaticRoute adds a routes to the sandbox.
// It may be used in addtion to or instead of a default gateway (as above).
// AddStaticRoute adds a route to the sandbox.
// It may be used in addition to or instead of a default gateway (as above).
AddStaticRoute(destination *net.IPNet, routeType int, nextHop net.IP) error

// DisableGatewayService tells libnetwork not to provide Default GW for the container
Expand Down
4 changes: 2 additions & 2 deletions vendor/src/github.com/docker/libnetwork/driverapi/ipamdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (i *IPAMData) UnmarshalJSON(data []byte) error {
return nil
}

// Validate checks wheter the IPAMData structure contains congruent data
// Validate checks whether the IPAMData structure contains congruent data
func (i *IPAMData) Validate() error {
var isV6 bool
if i.Pool == nil {
Expand Down Expand Up @@ -93,7 +93,7 @@ func (i *IPAMData) Validate() error {
return nil
}

// IsV6 returns wheter this is an IPv6 IPAMData structure
// IsV6 returns whether this is an IPv6 IPAMData structure
func (i *IPAMData) IsV6() bool {
return nil == i.Pool.IP.To4()
}
Expand Down
2 changes: 2 additions & 0 deletions vendor/src/github.com/docker/libnetwork/drivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/docker/libnetwork/netlabel"

builtinIpam "github.com/docker/libnetwork/ipams/builtin"
nullIpam "github.com/docker/libnetwork/ipams/null"
remoteIpam "github.com/docker/libnetwork/ipams/remote"
)

Expand Down Expand Up @@ -73,6 +74,7 @@ func initIpams(ic ipamapi.Callback, lDs, gDs interface{}) error {
for _, fn := range [](func(ipamapi.Callback, interface{}, interface{}) error){
builtinIpam.Init,
remoteIpam.Init,
nullIpam.Init,
} {
if err := fn(ic, lDs, gDs); err != nil {
return err
Expand Down
Loading

0 comments on commit 5a65408

Please sign in to comment.