├── Godeps ├── _workspace │ ├── .gitignore │ └── src │ │ ├── github.com │ │ ├── docker │ │ │ ├── docker │ │ │ │ ├── pkg │ │ │ │ │ ├── sockets │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── stringid │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── signal │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── signal_unsupported.go │ │ │ │ │ │ ├── signal_windows.go │ │ │ │ │ │ └── signal_unix.go │ │ │ │ │ ├── term │ │ │ │ │ │ ├── windows │ │ │ │ │ │ │ ├── windows_test.go │ │ │ │ │ │ │ └── windows.go │ │ │ │ │ │ └── tc_other.go │ │ │ │ │ ├── ioutils │ │ │ │ │ │ ├── scheduler.go │ │ │ │ │ │ ├── scheduler_gccgo.go │ │ │ │ │ │ ├── fmt_test.go │ │ │ │ │ │ └── fmt.go │ │ │ │ │ ├── symlink │ │ │ │ │ │ ├── fs_unix.go │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── system │ │ │ │ │ │ ├── meminfo_unsupported.go │ │ │ │ │ │ ├── errors.go │ │ │ │ │ │ ├── umask_windows.go │ │ │ │ │ │ ├── umask.go │ │ │ │ │ │ ├── mknod_windows.go │ │ │ │ │ │ ├── stat_unsupported.go │ │ │ │ │ │ ├── xattrs_unsupported.go │ │ │ │ │ │ ├── lstat.go │ │ │ │ │ │ ├── meminfo.go │ │ │ │ │ │ ├── utimes_darwin.go │ │ │ │ │ │ ├── utimes_unsupported.go │ │ │ │ │ │ ├── filesys.go │ │ │ │ │ │ ├── lstat_test.go │ │ │ │ │ │ ├── lstat_windows.go │ │ │ │ │ │ ├── stat_freebsd.go │ │ │ │ │ │ ├── stat_test.go │ │ │ │ │ │ ├── mknod.go │ │ │ │ │ │ ├── stat_linux.go │ │ │ │ │ │ ├── utimes_freebsd.go │ │ │ │ │ │ ├── stat_windows.go │ │ │ │ │ │ ├── meminfo_linux_test.go │ │ │ │ │ │ └── utimes_linux.go │ │ │ │ │ ├── reexec │ │ │ │ │ │ ├── command_unsupported.go │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── command_freebsd.go │ │ │ │ │ │ ├── command_windows.go │ │ │ │ │ │ └── command_linux.go │ │ │ │ │ ├── mount │ │ │ │ │ │ ├── mounter_unsupported.go │ │ │ │ │ │ ├── mountinfo_unsupported.go │ │ │ │ │ │ ├── mounter_linux.go │ │ │ │ │ │ ├── flags_unsupported.go │ │ │ │ │ │ └── mountinfo_freebsd.go │ │ │ │ │ ├── parsers │ │ │ │ │ │ ├── kernel │ │ │ │ │ │ │ ├── uname_unsupported.go │ │ │ │ │ │ │ └── uname_linux.go │ │ │ │ │ │ └── operatingsystem │ │ │ │ │ │ │ └── operatingsystem_linux.go │ │ │ │ │ ├── random │ │ │ │ │ │ └── random_test.go │ │ │ │ │ ├── homedir │ │ │ │ │ │ ├── homedir_test.go │ │ │ │ │ │ └── homedir.go │ │ │ │ │ ├── discovery │ │ │ │ │ │ └── generator.go │ │ │ │ │ ├── proxy │ │ │ │ │ │ └── stub_proxy.go │ │ │ │ │ ├── plugins │ │ │ │ │ │ └── pluginrpc-gen │ │ │ │ │ │ │ └── fixtures │ │ │ │ │ │ │ └── foo.go │ │ │ │ │ ├── mflag │ │ │ │ │ │ └── README.md │ │ │ │ │ └── listenbuffer │ │ │ │ │ │ ├── listen_buffer_test.go │ │ │ │ │ │ └── README.md │ │ │ │ └── api │ │ │ │ │ └── client │ │ │ │ │ ├── client.go │ │ │ │ │ ├── rename.go │ │ │ │ │ ├── stats_unit_test.go │ │ │ │ │ ├── help.go │ │ │ │ │ ├── pause.go │ │ │ │ │ ├── unpause.go │ │ │ │ │ ├── wait.go │ │ │ │ │ ├── load.go │ │ │ │ │ └── kill.go │ │ │ ├── libkv │ │ │ │ ├── script │ │ │ │ │ ├── travis_zk.sh │ │ │ │ │ ├── travis_etcd.sh │ │ │ │ │ ├── travis_consul.sh │ │ │ │ │ ├── coverage │ │ │ │ │ ├── validate-gofmt │ │ │ │ │ └── .validate │ │ │ │ ├── libkv_test.go │ │ │ │ └── libkv.go │ │ │ └── swarm │ │ │ │ ├── pkg │ │ │ │ └── store │ │ │ │ │ ├── etcd_test.go │ │ │ │ │ ├── zookeeper_test.go │ │ │ │ │ └── helpers.go │ │ │ │ └── discovery │ │ │ │ ├── generator.go │ │ │ │ └── token │ │ │ │ └── README.md │ │ ├── Sirupsen │ │ │ └── logrus │ │ │ │ ├── .gitignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── terminal_openbsd.go │ │ │ │ ├── terminal_linux.go │ │ │ │ ├── terminal_darwin.go │ │ │ │ ├── terminal_freebsd.go │ │ │ │ ├── hooks │ │ │ │ ├── syslog │ │ │ │ │ ├── README.md │ │ │ │ │ └── syslog_test.go │ │ │ │ └── papertrail │ │ │ │ │ └── papertrail_test.go │ │ │ │ ├── terminal_notwindows.go │ │ │ │ ├── json_formatter.go │ │ │ │ ├── writer.go │ │ │ │ ├── terminal_windows.go │ │ │ │ ├── text_formatter_test.go │ │ │ │ └── examples │ │ │ │ ├── basic │ │ │ │ └── basic.go │ │ │ │ └── hook │ │ │ │ └── hook.go │ │ ├── boltdb │ │ │ └── bolt │ │ │ │ ├── .gitignore │ │ │ │ ├── bolt_386.go │ │ │ │ ├── bolt_arm.go │ │ │ │ ├── boltsync_unix.go │ │ │ │ ├── bolt_amd64.go │ │ │ │ ├── bolt_linux.go │ │ │ │ ├── bolt_openbsd.go │ │ │ │ ├── bolt_test.go │ │ │ │ └── LICENSE │ │ ├── ugorji │ │ │ └── go │ │ │ │ └── codec │ │ │ │ ├── prebuild.go │ │ │ │ ├── codecgen │ │ │ │ ├── z.go │ │ │ │ └── README.md │ │ │ │ ├── codecgen_test.go │ │ │ │ ├── helper_not_unsafe.go │ │ │ │ └── py_test.go │ │ ├── BurntSushi │ │ │ └── toml │ │ │ │ ├── session.vim │ │ │ │ ├── .gitignore │ │ │ │ ├── COMPATIBLE │ │ │ │ ├── .travis.yml │ │ │ │ ├── Makefile │ │ │ │ ├── COPYING │ │ │ │ ├── cmd │ │ │ │ ├── tomlv │ │ │ │ │ ├── COPYING │ │ │ │ │ └── README.md │ │ │ │ ├── toml-test-decoder │ │ │ │ │ ├── COPYING │ │ │ │ │ └── README.md │ │ │ │ └── toml-test-encoder │ │ │ │ │ ├── COPYING │ │ │ │ │ └── README.md │ │ │ │ ├── encoding_types_1.1.go │ │ │ │ └── encoding_types.go │ │ ├── gorilla │ │ │ ├── mux │ │ │ │ ├── .travis.yml │ │ │ │ ├── README.md │ │ │ │ └── bench_test.go │ │ │ └── context │ │ │ │ ├── .travis.yml │ │ │ │ └── README.md │ │ ├── opencontainers │ │ │ └── runc │ │ │ │ └── libcontainer │ │ │ │ ├── cgroups │ │ │ │ ├── fs │ │ │ │ │ ├── fs_unsupported.go │ │ │ │ │ ├── perf_event.go │ │ │ │ │ ├── net_prio_test.go │ │ │ │ │ ├── net_cls.go │ │ │ │ │ ├── net_prio.go │ │ │ │ │ └── net_cls_test.go │ │ │ │ ├── cgroups_unsupported.go │ │ │ │ └── cgroups_test.go │ │ │ │ ├── criurpc │ │ │ │ └── Makefile │ │ │ │ ├── seccomp │ │ │ │ ├── seccomp_unsupported.go │ │ │ │ └── bpf.go │ │ │ │ ├── nsenter │ │ │ │ ├── nsenter_unsupported.go │ │ │ │ ├── nsenter.go │ │ │ │ └── nsenter_gccgo.go │ │ │ │ ├── stacktrace │ │ │ │ ├── stacktrace.go │ │ │ │ ├── frame_test.go │ │ │ │ ├── capture.go │ │ │ │ ├── capture_test.go │ │ │ │ └── frame.go │ │ │ │ ├── integration │ │ │ │ └── doc.go │ │ │ │ ├── stats_freebsd.go │ │ │ │ ├── stats_windows.go │ │ │ │ ├── user │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── lookup_unsupported.go │ │ │ │ └── lookup_unix.go │ │ │ │ ├── configs │ │ │ │ ├── namespaces.go │ │ │ │ ├── namespaces_windows.go │ │ │ │ ├── hugepage_limit.go │ │ │ │ ├── interface_priority_map.go │ │ │ │ ├── namespaces_syscall_unsupported.go │ │ │ │ ├── namespaces_syscall.go │ │ │ │ └── mount.go │ │ │ │ ├── netlink │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── netlink_linux_armppc64.go │ │ │ │ ├── netlink_linux_notarm.go │ │ │ │ └── netlink.go │ │ │ │ ├── stats_linux.go │ │ │ │ ├── xattr │ │ │ │ ├── errors.go │ │ │ │ └── xattr_unsupported.go │ │ │ │ ├── apparmor │ │ │ │ ├── apparmor_disabled.go │ │ │ │ └── apparmor.go │ │ │ │ ├── system │ │ │ │ ├── sysconfig.go │ │ │ │ ├── sysconfig_notcgo.go │ │ │ │ ├── syscall_linux_386.go │ │ │ │ ├── syscall_linux_arm.go │ │ │ │ ├── syscall_linux_64.go │ │ │ │ └── proc.go │ │ │ │ ├── compat_1.5_linux.go │ │ │ │ ├── generic_error_test.go │ │ │ │ ├── container_nouserns_linux.go │ │ │ │ ├── stats.go │ │ │ │ ├── console.go │ │ │ │ ├── setgroups_linux.go │ │ │ │ ├── devices │ │ │ │ ├── devices_windows.go │ │ │ │ └── number.go │ │ │ │ ├── console_freebsd.go │ │ │ │ ├── hack │ │ │ │ └── validate.sh │ │ │ │ ├── error_test.go │ │ │ │ ├── utils │ │ │ │ ├── utils_test.go │ │ │ │ └── utils_unix.go │ │ │ │ ├── console_windows.go │ │ │ │ ├── container_userns_linux.go │ │ │ │ ├── criu_opts.go │ │ │ │ ├── rootfs_linux_test.go │ │ │ │ └── setns_init_linux.go │ │ ├── vishvananda │ │ │ ├── netlink │ │ │ │ ├── .travis.yml │ │ │ │ ├── link_tuntap_linux.go │ │ │ │ ├── neigh.go │ │ │ │ ├── Makefile │ │ │ │ ├── nl │ │ │ │ │ ├── route_linux.go │ │ │ │ │ └── addr_linux.go │ │ │ │ └── addr.go │ │ │ └── netns │ │ │ │ ├── netns_linux_386.go │ │ │ │ ├── netns_linux_arm.go │ │ │ │ ├── netns_linux_amd64.go │ │ │ │ ├── netns_linux_arm64.go │ │ │ │ ├── netns_linux_ppc64le.go │ │ │ │ ├── netns_linux_s390x.go │ │ │ │ └── netns_unspecified.go │ │ ├── godbus │ │ │ └── dbus │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── transport_darwin.go │ │ │ │ ├── homedir_dynamic.go │ │ │ │ ├── homedir.go │ │ │ │ ├── conn_darwin.go │ │ │ │ ├── conn_other.go │ │ │ │ ├── auth_external.go │ │ │ │ ├── introspect │ │ │ │ └── call.go │ │ │ │ ├── transport_unixcred_linux.go │ │ │ │ ├── transport_generic.go │ │ │ │ ├── homedir_static.go │ │ │ │ └── examples_test.go │ │ ├── deckarep │ │ │ └── golang-set │ │ │ │ ├── .travis.yml │ │ │ │ └── .gitignore │ │ ├── codegangsta │ │ │ └── cli │ │ │ │ ├── autocomplete │ │ │ │ ├── zsh_autocomplete │ │ │ │ └── bash_autocomplete │ │ │ │ ├── .travis.yml │ │ │ │ ├── helpers_test.go │ │ │ │ ├── help_test.go │ │ │ │ └── cli.go │ │ ├── armon │ │ │ └── go-metrics │ │ │ │ ├── const_unix.go │ │ │ │ ├── const_windows.go │ │ │ │ ├── .gitignore │ │ │ │ └── LICENSE │ │ ├── hashicorp │ │ │ ├── memberlist │ │ │ │ ├── todo.md │ │ │ │ ├── Makefile │ │ │ │ ├── .gitignore │ │ │ │ ├── conflict_delegate.go │ │ │ │ ├── merge_delegate.go │ │ │ │ ├── test │ │ │ │ │ └── setup_subnet.sh │ │ │ │ └── broadcast_test.go │ │ │ ├── serf │ │ │ │ └── serf │ │ │ │ │ ├── config_test.go │ │ │ │ │ ├── conflict_delegate.go │ │ │ │ │ ├── event_delegate.go │ │ │ │ │ ├── broadcast.go │ │ │ │ │ ├── lamport_test.go │ │ │ │ │ ├── broadcast_test.go │ │ │ │ │ └── merge_delegate.go │ │ │ └── consul │ │ │ │ └── api │ │ │ │ ├── status_test.go │ │ │ │ ├── event_test.go │ │ │ │ ├── README.md │ │ │ │ └── status.go │ │ ├── stretchr │ │ │ └── testify │ │ │ │ └── assert │ │ │ │ └── errors.go │ │ ├── samuel │ │ │ └── go-zookeeper │ │ │ │ └── zk │ │ │ │ ├── util_test.go │ │ │ │ └── constants_test.go │ │ ├── coreos │ │ │ └── etcd │ │ │ │ ├── client │ │ │ │ ├── cancelreq_go14.go │ │ │ │ ├── cancelreq.go │ │ │ │ ├── discover.go │ │ │ │ └── cluster_error.go │ │ │ │ └── pkg │ │ │ │ ├── pathutil │ │ │ │ └── path.go │ │ │ │ └── types │ │ │ │ ├── slice.go │ │ │ │ └── slice_test.go │ │ └── syndtr │ │ │ └── gocapability │ │ │ └── capability │ │ │ └── capability_noop.go │ │ └── golang.org │ │ └── x │ │ └── net │ │ └── context │ │ └── withtimeout_test.go └── Readme ├── resolvconf ├── README.md └── dns │ └── resolvconf.go ├── osl ├── neigh_freebsd.go ├── neigh_windows.go ├── interface_freebsd.go ├── interface_windows.go ├── namespace_unsupported.go ├── sandbox_unsupported_test.go ├── sandbox_unsupported.go ├── sandbox_freebsd.go └── namespace_windows.go ├── wrapmake.sh ├── drivers └── bridge │ ├── netlink_deprecated_linux_armppc64.go │ ├── netlink_deprecated_linux_notarm.go │ ├── setup_bridgenetfiltering_test.go │ ├── netlink_deprecated_unsupported.go │ ├── setup_firewalld.go │ ├── labels.go │ ├── setup.go │ ├── setup_ip_forwarding.go │ ├── link_test.go │ └── interface_test.go ├── hostdiscovery ├── libnetwork.toml └── hostdiscovery_api.go ├── test └── integration │ ├── daemon.cfg │ └── dnet │ ├── overlay-etcd.bats │ ├── overlay-consul.bats │ ├── overlay-zookeeper.bats │ └── dnet.bats ├── circle.yml ├── drivers_windows.go ├── MAINTAINERS ├── default_gateway_freebsd.go ├── default_gateway_windows.go ├── drivers_freebsd.go ├── cmd └── dnet │ └── libnetwork.toml ├── config └── libnetwork.toml ├── testutils ├── net.go └── context.go ├── portmapper └── mock_proxy.go ├── docs ├── vagrant-systemd │ └── docker.service ├── bridge.md └── legacy.md ├── drivers_linux.go ├── .gitignore ├── default_gateway_linux.go ├── netlabel └── labels_test.go ├── ipams └── builtin │ └── builtin.go ├── ipamutils └── utils_windows.go ├── ROADMAP.md └── ns └── init_linux.go /Godeps/_workspace/.gitignore: -------------------------------------------------------------------------------- 1 | /pkg 2 | /bin 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/sockets/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/.gitignore: -------------------------------------------------------------------------------- 1 | *.prof 2 | *.test 3 | *.swp 4 | /bin/ 5 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ugorji/go/codec/prebuild.go: -------------------------------------------------------------------------------- 1 | package codec 2 | 3 | //go:generate bash prebuild.sh 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim: -------------------------------------------------------------------------------- 1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /resolvconf/README.md: -------------------------------------------------------------------------------- 1 | Package resolvconf provides utility code to query and update DNS configuration in /etc/resolv.conf 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore: -------------------------------------------------------------------------------- 1 | TAGS 2 | tags 3 | .*.swp 4 | tomlcheck/tomlcheck 5 | toml.test 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/mux/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - tip 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package fs 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/z.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | const genCodecPath = "github.com/ugorji/go/codec" 4 | -------------------------------------------------------------------------------- /osl/neigh_freebsd.go: -------------------------------------------------------------------------------- 1 | package osl 2 | 3 | // NeighOption is a function option type to set neighbor options 4 | type NeighOption func() 5 | -------------------------------------------------------------------------------- /osl/neigh_windows.go: -------------------------------------------------------------------------------- 1 | package osl 2 | 3 | // NeighOption is a function option type to set neighbor options 4 | type NeighOption func() 5 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/cgroups_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package cgroups 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/criurpc/Makefile: -------------------------------------------------------------------------------- 1 | gen: criurpc.proto 2 | protoc --go_out=. criurpc.proto 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package seccomp 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netlink/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | install: 3 | - go get github.com/vishvananda/netns 4 | -------------------------------------------------------------------------------- /osl/interface_freebsd.go: -------------------------------------------------------------------------------- 1 | package osl 2 | 3 | // IfaceOption is a function option type to set interface options 4 | type IfaceOption func() 5 | -------------------------------------------------------------------------------- /osl/interface_windows.go: -------------------------------------------------------------------------------- 1 | package osl 2 | 3 | // IfaceOption is a function option type to set interface options 4 | type IfaceOption func() 5 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/stringid/README.md: -------------------------------------------------------------------------------- 1 | This package provides helper functions for dealing with string identifiers 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Brandon Philips (@philips) 2 | Brian Waldon (@bcwaldon) 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/signal/README.md: -------------------------------------------------------------------------------- 1 | This package provides helper functions for dealing with signals across various operating systems -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/term/windows/windows_test.go: -------------------------------------------------------------------------------- 1 | // This file is necessary to pass the Docker tests. 2 | 3 | package windows 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_386.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 2 | 3 | package netns 4 | 5 | const ( 6 | SYS_SETNS = 346 7 | ) 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_arm.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm 2 | 3 | package netns 4 | 5 | const ( 6 | SYS_SETNS = 375 7 | ) 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/ioutils/scheduler.go: -------------------------------------------------------------------------------- 1 | // +build !gccgo 2 | 3 | package ioutils 4 | 5 | func callSchedulerIfNecessary() { 6 | } 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux !cgo 2 | 3 | package nsenter 4 | 5 | import "C" 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // +build linux,amd64 2 | 3 | package netns 4 | 5 | const ( 6 | SYS_SETNS = 308 7 | ) 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 2 | 3 | package netns 4 | 5 | const ( 6 | SYS_SETNS = 268 7 | ) 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build linux,ppc64le 2 | 3 | package netns 4 | 5 | const ( 6 | SYS_SETNS = 350 7 | ) 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netns/netns_linux_s390x.go: -------------------------------------------------------------------------------- 1 | // +build linux,s390x 2 | 3 | package netns 4 | 5 | const ( 6 | SYS_SETNS = 339 7 | ) 8 | -------------------------------------------------------------------------------- /wrapmake.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | function raise() 6 | { 7 | kill -$1 0 8 | } 9 | 10 | trap "raise SIGINT" SIGINT 11 | make $1 12 | -------------------------------------------------------------------------------- /Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.2 4 | - 1.3 5 | - 1.4 6 | - tip 7 | install: 8 | - go get -t ./... 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/context/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - 1.3 8 | - 1.4 9 | - tip 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stacktrace/stacktrace.go: -------------------------------------------------------------------------------- 1 | package stacktrace 2 | 3 | type Stacktrace struct { 4 | Frames []Frame 5 | } 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/integration/doc.go: -------------------------------------------------------------------------------- 1 | // integration is used for integration testing of libcontainer 2 | package integration 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stats_freebsd.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | type Stats struct { 4 | Interfaces []*NetworkInterface 5 | } 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stats_windows.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | type Stats struct { 4 | Interfaces []*NetworkInterface 5 | } 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Tianon Gravi (@tianon) 2 | Aleksa Sarai (@cyphar) 3 | -------------------------------------------------------------------------------- /drivers/bridge/netlink_deprecated_linux_armppc64.go: -------------------------------------------------------------------------------- 1 | // +build arm ppc64 ppc64le 2 | 3 | package bridge 4 | 5 | func ifrDataByte(b byte) uint8 { 6 | return uint8(b) 7 | } 8 | -------------------------------------------------------------------------------- /drivers/bridge/netlink_deprecated_linux_notarm.go: -------------------------------------------------------------------------------- 1 | // +build !arm,!ppc64,!ppc64le 2 | 3 | package bridge 4 | 5 | func ifrDataByte(b byte) int8 { 6 | return int8(b) 7 | } 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version 2 | [v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md) 3 | 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs/namespaces.go: -------------------------------------------------------------------------------- 1 | package configs 2 | 3 | type NamespaceType string 4 | 5 | type Namespaces []Namespace 6 | -------------------------------------------------------------------------------- /hostdiscovery/libnetwork.toml: -------------------------------------------------------------------------------- 1 | title = "LibNetwork Configuration file" 2 | 3 | [cluster] 4 | discovery = "consul://localhost:8500" 5 | Address = "6.5.5.5" 6 | Heartbeat = 3 7 | -------------------------------------------------------------------------------- /test/integration/daemon.cfg: -------------------------------------------------------------------------------- 1 | CACERT=/var/lib/boot2docker/ca.pem 2 | SERVERCERT=/var/lib/boot2docker/server-key.pem 3 | SERVERKEY=/var/lib/boot2docker/server.pem 4 | DOCKER_TLS=no 5 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/transport_darwin.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | func (t *unixTransport) SendNullByte() error { 4 | _, err := t.Write([]byte{0}) 5 | return err 6 | } 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/deckarep/golang-set/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.2 5 | 6 | script: 7 | - go test ./... 8 | #- go test -race ./... 9 | 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_openbsd.go: -------------------------------------------------------------------------------- 1 | 2 | package logrus 3 | 4 | import "syscall" 5 | 6 | const ioctlReadTermios = syscall.TIOCGETA 7 | 8 | type Termios syscall.Termios 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/netlink/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Michael Crosby (@crosbymichael) 2 | Guillaume J. Charmes (@creack) 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/netlink/netlink_linux_armppc64.go: -------------------------------------------------------------------------------- 1 | // +build arm ppc64 2 | 3 | package netlink 4 | 5 | func ifrDataByte(b byte) uint8 { 6 | return uint8(b) 7 | } 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/netlink/netlink_linux_notarm.go: -------------------------------------------------------------------------------- 1 | // +build !arm,!ppc64 2 | 3 | package netlink 4 | 5 | func ifrDataByte(b byte) int8 { 6 | return int8(b) 7 | } 8 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | services: 3 | - docker 4 | 5 | dependencies: 6 | override: 7 | - echo "Nothing to install" 8 | 9 | test: 10 | override: 11 | - make circle-ci 12 | 13 | -------------------------------------------------------------------------------- /test/integration/dnet/overlay-etcd.bats: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | #!/usr/bin/env bats 3 | 4 | load helpers 5 | 6 | @test "Test overlay network with etcd" { 7 | skip_for_circleci 8 | test_overlay etcd 9 | } 10 | -------------------------------------------------------------------------------- /test/integration/dnet/overlay-consul.bats: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | #!/usr/bin/env bats 3 | 4 | load helpers 5 | 6 | @test "Test overlay network with consul" { 7 | skip_for_circleci 8 | test_overlay consul 9 | } 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/codegangsta/cli/autocomplete/zsh_autocomplete: -------------------------------------------------------------------------------- 1 | autoload -U compinit && compinit 2 | autoload -U bashcompinit && bashcompinit 3 | 4 | script_dir=$(dirname $0) 5 | source ${script_dir}/bash_autocomplete 6 | -------------------------------------------------------------------------------- /drivers_windows.go: -------------------------------------------------------------------------------- 1 | package libnetwork 2 | 3 | import "github.com/docker/libnetwork/drivers/windows" 4 | 5 | func getInitializers() []initializer { 6 | return []initializer{ 7 | {windows.Init, "windows"}, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/codegangsta/cli/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.0.3 6 | - 1.1.2 7 | - 1.2.2 8 | - 1.3.3 9 | - 1.4.2 10 | 11 | script: 12 | - go vet ./... 13 | - go test -v ./... 14 | -------------------------------------------------------------------------------- /test/integration/dnet/overlay-zookeeper.bats: -------------------------------------------------------------------------------- 1 | # -*- mode: sh -*- 2 | #!/usr/bin/env bats 3 | 4 | load helpers 5 | 6 | @test "Test overlay network with zookeeper" { 7 | skip_for_circleci 8 | test_overlay zookeeper 9 | } 10 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Alessandro Boch (@aboch) 2 | Alexandr Morozov (@LK4D4) 3 | Arnaud Porterie (@icecrime) 4 | Jana Radhakrishnan (@mrjana) 5 | Madhu Venugopal (@mavenugo) 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/armon/go-metrics/const_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package metrics 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | const ( 10 | // DefaultSignal is used with DefaultInmemSignal 11 | DefaultSignal = syscall.SIGUSR1 12 | ) 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/fs_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package symlink 4 | 5 | import ( 6 | "path/filepath" 7 | ) 8 | 9 | func evalSymlinks(path string) (string, error) { 10 | return filepath.EvalSymlinks(path) 11 | } 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stats_linux.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | import "github.com/opencontainers/runc/libcontainer/cgroups" 4 | 5 | type Stats struct { 6 | Interfaces []*NetworkInterface 7 | CgroupStats *cgroups.Stats 8 | } 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/xattr/errors.go: -------------------------------------------------------------------------------- 1 | package xattr 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | var ErrNotSupportedPlatform = fmt.Errorf("platform and architecture is not supported %s %s", runtime.GOOS, runtime.GOARCH) 9 | -------------------------------------------------------------------------------- /default_gateway_freebsd.go: -------------------------------------------------------------------------------- 1 | package libnetwork 2 | 3 | import "github.com/docker/libnetwork/types" 4 | 5 | func (c *controller) createGWNetwork() (Network, error) { 6 | return nil, types.NotImplementedErrorf("default gateway functionality is not implemented in freebsd") 7 | } 8 | -------------------------------------------------------------------------------- /default_gateway_windows.go: -------------------------------------------------------------------------------- 1 | package libnetwork 2 | 3 | import "github.com/docker/libnetwork/types" 4 | 5 | func (c *controller) createGWNetwork() (Network, error) { 6 | return nil, types.NotImplementedErrorf("default gateway functionality is not implemented in windows") 7 | } 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_disabled.go: -------------------------------------------------------------------------------- 1 | // +build !apparmor !linux 2 | 3 | package apparmor 4 | 5 | func IsEnabled() bool { 6 | return false 7 | } 8 | 9 | func ApplyProfile(name string) error { 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs/namespaces_windows.go: -------------------------------------------------------------------------------- 1 | package configs 2 | 3 | // Namespace defines configuration for each namespace. It specifies an 4 | // alternate path that is able to be joined via setns. 5 | type Namespace struct { 6 | } 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/bolt_386.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/bolt_arm.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/boltsync_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!linux,!openbsd 2 | 3 | package bolt 4 | 5 | var odirect int 6 | 7 | // fdatasync flushes written data to a file descriptor. 8 | func fdatasync(db *DB) error { 9 | return db.file.Sync() 10 | } 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/memberlist/todo.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | * Dynamic RTT discovery 3 | * Compute 99th percentile for ping/ack 4 | * Better lower bound for ping/ack, faster failure detection 5 | * Dynamic MTU discovery 6 | * Prevent lost updates, increases efficiency 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.1 4 | - 1.2 5 | - tip 6 | install: 7 | - go install ./... 8 | - go get github.com/BurntSushi/toml-test 9 | script: 10 | - export PATH="$PATH:$HOME/gopath/bin" 11 | - make test 12 | 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/serf/serf/config_test.go: -------------------------------------------------------------------------------- 1 | package serf 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestDefaultConfig(t *testing.T) { 8 | c := DefaultConfig() 9 | if c.ProtocolVersion != ProtocolVersionMax { 10 | t.Fatalf("bad: %#v", c) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/system/sysconfig.go: -------------------------------------------------------------------------------- 1 | // +build cgo,linux cgo,freebsd 2 | 3 | package system 4 | 5 | /* 6 | #include 7 | */ 8 | import "C" 9 | 10 | func GetClockTicks() int { 11 | return int(C.sysconf(C._SC_CLK_TCK)) 12 | } 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/bolt_amd64.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0x7FFFFFFF 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/meminfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows 2 | 3 | package system 4 | 5 | // ReadMemInfo is not supported on platforms other than linux and windows. 6 | func ReadMemInfo() (*MemInfo, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go: -------------------------------------------------------------------------------- 1 | // +build linux,!gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/errors.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | // ErrNotSupportedPlatform means the platform is not supported. 9 | ErrNotSupportedPlatform = errors.New("platform and architecture is not supported") 10 | ) 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/homedir_dynamic.go: -------------------------------------------------------------------------------- 1 | // +build !static_build 2 | 3 | package dbus 4 | 5 | import ( 6 | "os/user" 7 | ) 8 | 9 | func lookupHomeDir() string { 10 | u, err := user.Current() 11 | if err != nil { 12 | return "/" 13 | } 14 | return u.HomeDir 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/signal/signal_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!darwin,!freebsd 2 | 3 | package signal 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // SignalMap is an empty map of signals for unsupported platform. 10 | var SignalMap = map[string]syscall.Signal{} 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs/hugepage_limit.go: -------------------------------------------------------------------------------- 1 | package configs 2 | 3 | type HugepageLimit struct { 4 | // which type of hugepage to limit. 5 | Pagesize string `json:"page_size"` 6 | 7 | // usage limit for hugepage. 8 | Limit int `json:"limit"` 9 | } 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/bolt_linux.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var odirect = syscall.O_DIRECT 8 | 9 | // fdatasync flushes written data to a file descriptor. 10 | func fdatasync(db *DB) error { 11 | return syscall.Fdatasync(int(db.file.Fd())) 12 | } 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/mux/README.md: -------------------------------------------------------------------------------- 1 | mux 2 | === 3 | [![Build Status](https://travis-ci.org/gorilla/mux.png?branch=master)](https://travis-ci.org/gorilla/mux) 4 | 5 | gorilla/mux is a powerful URL router and dispatcher. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/mux 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/armon/go-metrics/const_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package metrics 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | const ( 10 | // DefaultSignal is used with DefaultInmemSignal 11 | // Windows has no SIGUSR1, use SIGBREAK 12 | DefaultSignal = syscall.Signal(21) 13 | ) 14 | -------------------------------------------------------------------------------- /drivers_freebsd.go: -------------------------------------------------------------------------------- 1 | package libnetwork 2 | 3 | import ( 4 | "github.com/docker/libnetwork/drivers/null" 5 | "github.com/docker/libnetwork/drivers/remote" 6 | ) 7 | 8 | func getInitializers() []initializer { 9 | return []initializer{ 10 | {null.Init, "null"}, 11 | {remote.Init, "remote"}, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /osl/namespace_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd 2 | 3 | package osl 4 | 5 | // GC triggers garbage collection of namespace path right away 6 | // and waits for it. 7 | func GC() { 8 | } 9 | 10 | func GetSandboxForExternalKey(path string, key string) (Sandbox, error) { 11 | return nil, nil 12 | } 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/umask_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Umask is not supported on the windows platform. 6 | func Umask(newmask int) (oldmask int, err error) { 7 | // should not be called on cli code path 8 | return 0, ErrNotSupportedPlatform 9 | } 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/reexec/command_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Command is unsupported on operating systems apart from Linux and Windows. 10 | func Command(args ...string) *exec.Cmd { 11 | return nil 12 | } 13 | -------------------------------------------------------------------------------- /cmd/dnet/libnetwork.toml: -------------------------------------------------------------------------------- 1 | title = "LibNetwork Configuration file" 2 | 3 | [daemon] 4 | debug = false 5 | [cluster] 6 | discovery = "consul://localhost:8500" 7 | Address = "1.1.1.1" 8 | Heartbeat = 20 9 | [datastore] 10 | embedded = false 11 | [datastore.client] 12 | provider = "consul" 13 | Address = "localhost:8500" 14 | -------------------------------------------------------------------------------- /config/libnetwork.toml: -------------------------------------------------------------------------------- 1 | title = "LibNetwork Configuration file" 2 | 3 | [daemon] 4 | debug = false 5 | [cluster] 6 | discovery = "token://swarm-discovery-token" 7 | Address = "Cluster-wide reachable Host IP" 8 | [datastore] 9 | embedded = false 10 | [datastore.client] 11 | provider = "consul" 12 | Address = "localhost:8500" 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/compat_1.5_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux,!go1.5 2 | 3 | package libcontainer 4 | 5 | import "syscall" 6 | 7 | // GidMappingsEnableSetgroups was added in Go 1.5, so do nothing when building 8 | // with earlier versions 9 | func enableSetgroups(sys *syscall.SysProcAttr) { 10 | } 11 | -------------------------------------------------------------------------------- /testutils/net.go: -------------------------------------------------------------------------------- 1 | package testutils 2 | 3 | import "flag" 4 | 5 | var runningInContainer = flag.Bool("incontainer", false, "Indicates if the test is running in a container") 6 | 7 | // IsRunningInContainer returns whether the test is running inside a container. 8 | func IsRunningInContainer() bool { 9 | return (*runningInContainer) 10 | } 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mounter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd freebsd,!cgo 2 | 3 | package mount 4 | 5 | func mount(device, target, mType string, flag uintptr, data string) error { 6 | panic("Not implemented") 7 | } 8 | 9 | func unmount(target string, flag int) error { 10 | panic("Not implemented") 11 | } 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/umask.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Umask sets current process's file mode creation mask to newmask 10 | // and return oldmask. 11 | func Umask(newmask int) (oldmask int, err error) { 12 | return syscall.Umask(newmask), nil 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/context/README.md: -------------------------------------------------------------------------------- 1 | context 2 | ======= 3 | [![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) 4 | 5 | gorilla/context is a general purpose registry for global request variables. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/memberlist/Makefile: -------------------------------------------------------------------------------- 1 | test: subnet 2 | go test ./... 3 | 4 | integ: subnet 5 | INTEG_TESTS=yes go test ./... 6 | 7 | subnet: 8 | ./test/setup_subnet.sh 9 | 10 | cov: 11 | gocov test github.com/hashicorp/memberlist | gocov-html > /tmp/coverage.html 12 | open /tmp/coverage.html 13 | 14 | .PNONY: test cov integ 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/serf/serf/conflict_delegate.go: -------------------------------------------------------------------------------- 1 | package serf 2 | 3 | import ( 4 | "github.com/hashicorp/memberlist" 5 | ) 6 | 7 | type conflictDelegate struct { 8 | serf *Serf 9 | } 10 | 11 | func (c *conflictDelegate) NotifyConflict(existing, other *memberlist.Node) { 12 | c.serf.handleNodeConflict(existing, other) 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd freebsd,!cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "fmt" 7 | "runtime" 8 | ) 9 | 10 | func parseMountTable() ([]*Info, error) { 11 | return nil, fmt.Errorf("mount.parseMountTable is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 12 | } 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/parsers/kernel/uname_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package kernel 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | type Utsname struct { 10 | Release [65]byte 11 | } 12 | 13 | func uname() (*Utsname, error) { 14 | return nil, errors.New("Kernel version detection is available only on linux") 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/reexec/README.md: -------------------------------------------------------------------------------- 1 | ## reexec 2 | 3 | The `reexec` package facilitates the busybox style reexec of the docker binary that we require because 4 | of the forking limitations of using Go. Handlers can be registered with a name and the argv 0 of 5 | the exec of the binary will be used to find and execute custom init paths. 6 | -------------------------------------------------------------------------------- /osl/sandbox_unsupported_test.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package osl 4 | 5 | import ( 6 | "errors" 7 | "testing" 8 | ) 9 | 10 | var ErrNotImplemented = errors.New("not implemented") 11 | 12 | func newKey(t *testing.T) (string, error) { 13 | return nil, ErrNotImplemented 14 | } 15 | 16 | func verifySandbox(t *testing.T, s Sandbox) { 17 | return 18 | } 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/parsers/kernel/uname_linux.go: -------------------------------------------------------------------------------- 1 | package kernel 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | type Utsname syscall.Utsname 8 | 9 | func uname() (*syscall.Utsname, error) { 10 | uts := &syscall.Utsname{} 11 | 12 | if err := syscall.Uname(uts); err != nil { 13 | return nil, err 14 | } 15 | return uts, nil 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/ioutils/scheduler_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build gccgo 2 | 3 | package ioutils 4 | 5 | import ( 6 | "runtime" 7 | ) 8 | 9 | func callSchedulerIfNecessary() { 10 | //allow or force Go scheduler to switch context, without explicitly 11 | //forcing this will make it hang when using gccgo implementation 12 | runtime.Gosched() 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/generic_error_test.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "testing" 7 | ) 8 | 9 | func TestErrorDetail(t *testing.T) { 10 | err := newGenericError(fmt.Errorf("test error"), SystemError) 11 | if derr := err.Detail(ioutil.Discard); derr != nil { 12 | t.Fatal(derr) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/term/windows/windows.go: -------------------------------------------------------------------------------- 1 | // These files implement ANSI-aware input and output streams for use by the Docker Windows client. 2 | // When asked for the set of standard streams (e.g., stdin, stdout, stderr), the code will create 3 | // and return pseudo-streams that convert ANSI sequences to / from Windows Console API calls. 4 | 5 | package windows 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs/interface_priority_map.go: -------------------------------------------------------------------------------- 1 | package configs 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type IfPrioMap struct { 8 | Interface string `json:"interface"` 9 | Priority int64 `json:"priority"` 10 | } 11 | 12 | func (i *IfPrioMap) CgroupString() string { 13 | return fmt.Sprintf("%s %d", i.Interface, i.Priority) 14 | } 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/container_nouserns_linux.go: -------------------------------------------------------------------------------- 1 | // +build !go1.4 2 | 3 | package libcontainer 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | ) 9 | 10 | // not available before go 1.4 11 | func (c *linuxContainer) addUidGidMappings(sys *syscall.SysProcAttr) error { 12 | return fmt.Errorf("User namespace is not supported in golang < 1.4") 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stats.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | type NetworkInterface struct { 4 | // Name is the name of the network interface. 5 | Name string 6 | 7 | RxBytes uint64 8 | RxPackets uint64 9 | RxErrors uint64 10 | RxDropped uint64 11 | TxBytes uint64 12 | TxPackets uint64 13 | TxErrors uint64 14 | TxDropped uint64 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package logrus 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_darwin.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package logrus 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/armon/go-metrics/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/console.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | import "io" 4 | 5 | // Console represents a pseudo TTY. 6 | type Console interface { 7 | io.ReadWriter 8 | io.Closer 9 | 10 | // Path returns the filesystem path to the slave side of the pty. 11 | Path() string 12 | 13 | // Fd returns the fd for the master of the pty. 14 | Fd() uintptr 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/deckarep/golang-set/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netlink/link_tuntap_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | // ideally golang.org/x/sys/unix would define IfReq but it only has 4 | // IFNAMSIZ, hence this minimalistic implementation 5 | const ( 6 | SizeOfIfReq = 40 7 | IFNAMSIZ = 16 8 | ) 9 | 10 | type ifReq struct { 11 | Name [IFNAMSIZ]byte 12 | Flags uint16 13 | pad [SizeOfIfReq - IFNAMSIZ - 2]byte 14 | } 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/setgroups_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux,go1.5 2 | 3 | package libcontainer 4 | 5 | import "syscall" 6 | 7 | // Set the GidMappingsEnableSetgroups member to true, so the process's 8 | // setgroups proc entry wont be set to 'deny' if GidMappings are set 9 | func enableSetgroups(sys *syscall.SysProcAttr) { 10 | sys.GidMappingsEnableSetgroups = true 11 | } 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/mknod_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Mknod is not implemented on Windows. 6 | func Mknod(path string, mode uint32, dev int) error { 7 | return ErrNotSupportedPlatform 8 | } 9 | 10 | // Mkdev is not implemented on Windows. 11 | func Mkdev(major int64, minor int64) uint32 { 12 | panic("Mkdev not implemented on Windows.") 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/script/travis_zk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -gt 0 ] ; then 4 | ZK_VERSION="$1" 5 | else 6 | ZK_VERSION="3.4.6" 7 | fi 8 | 9 | wget "http://mirrors.ukfast.co.uk/sites/ftp.apache.org/zookeeper/stable/zookeeper-${ZK_VERSION}.tar.gz" 10 | tar -xvf "zookeeper-${ZK_VERSION}.tar.gz" 11 | mv zookeeper-$ZK_VERSION zk 12 | mv ./zk/conf/zoo_sample.cfg ./zk/conf/zoo.cfg 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | go install ./... 3 | 4 | test: install 5 | go test -v 6 | toml-test toml-test-decoder 7 | toml-test -encoder toml-test-encoder 8 | 9 | fmt: 10 | gofmt -w *.go */*.go 11 | colcheck *.go */*.go 12 | 13 | tags: 14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS 15 | 16 | push: 17 | git push origin master 18 | git push github master 19 | 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /portmapper/mock_proxy.go: -------------------------------------------------------------------------------- 1 | package portmapper 2 | 3 | import "net" 4 | 5 | func newMockProxyCommand(proto string, hostIP net.IP, hostPort int, containerIP net.IP, containerPort int) userlandProxy { 6 | return &mockProxyCommand{} 7 | } 8 | 9 | type mockProxyCommand struct { 10 | } 11 | 12 | func (p *mockProxyCommand) Start() error { 13 | return nil 14 | } 15 | 16 | func (p *mockProxyCommand) Stop() error { 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/script/travis_etcd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -gt 0 ] ; then 4 | ETCD_VERSION="$1" 5 | else 6 | ETCD_VERSION="2.2.0" 7 | fi 8 | 9 | curl -L https://github.com/coreos/etcd/releases/download/v$ETCD_VERSION/etcd-v$ETCD_VERSION-linux-amd64.tar.gz -o etcd-v$ETCD_VERSION-linux-amd64.tar.gz 10 | tar xzvf etcd-v$ETCD_VERSION-linux-amd64.tar.gz 11 | mv etcd-v$ETCD_VERSION-linux-amd64 etcd 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/random/random_test.go: -------------------------------------------------------------------------------- 1 | package random 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | "testing" 7 | ) 8 | 9 | // for go test -v -race 10 | func TestConcurrency(t *testing.T) { 11 | rnd := rand.New(NewSource()) 12 | var wg sync.WaitGroup 13 | 14 | for i := 0; i < 10; i++ { 15 | wg.Add(1) 16 | go func() { 17 | rnd.Int63() 18 | wg.Done() 19 | }() 20 | } 21 | wg.Wait() 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/memberlist/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | .vagrant/ 25 | 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/xattr/xattr_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package xattr 4 | 5 | func Listxattr(path string) ([]string, error) { 6 | return nil, ErrNotSupportedPlatform 7 | } 8 | 9 | func Getxattr(path, attr string) (string, error) { 10 | return "", ErrNotSupportedPlatform 11 | } 12 | 13 | func Setxattr(path, xattr, value string) error { 14 | return ErrNotSupportedPlatform 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/README.md: -------------------------------------------------------------------------------- 1 | Package symlink implements EvalSymlinksInScope which is an extension of filepath.EvalSymlinks, 2 | as well as a Windows long-path aware version of filepath.EvalSymlinks 3 | from the [Go standard library](https://golang.org/pkg/path/filepath). 4 | 5 | The code from filepath.EvalSymlinks has been adapted in fs.go. 6 | Please read the LICENSE.BSD file that governs fs.go and LICENSE.APACHE for fs_test.go. 7 | -------------------------------------------------------------------------------- /drivers/bridge/setup_bridgenetfiltering_test.go: -------------------------------------------------------------------------------- 1 | package bridge 2 | 3 | import "testing" 4 | 5 | func TestIPConstantValues(t *testing.T) { 6 | if ipv4|ipv6 != ipvboth { 7 | t.Fatalf("bitwise or of ipv4(%04b) and ipv6(%04b) must yield ipvboth(%04b)", ipv4, ipv6, ipvboth) 8 | } 9 | if ipvboth&(^(ipv4 | ipv6)) != ipvnone { 10 | t.Fatalf("ipvboth(%04b) with unset ipv4(%04b) and ipv6(%04b) bits shall equal to ipvnone", ipvboth, ipv4, ipv6) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/vagrant-systemd/docker.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Application Container Engine 3 | Documentation=https://docs.docker.com 4 | After=network.target docker.socket 5 | Requires=docker.socket 6 | 7 | [Service] 8 | EnvironmentFile=-/etc/default/docker 9 | ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS 10 | MountFlags=slave 11 | LimitNOFILE=1048576 12 | LimitNPROC=1048576 13 | LimitCORE=infinity 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/stat_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 11 | return &StatT{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtimespec}, nil 17 | } 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/memberlist/conflict_delegate.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | // ConflictDelegate is a used to inform a client that 4 | // a node has attempted to join which would result in a 5 | // name conflict. This happens if two clients are configured 6 | // with the same name but different addresses. 7 | type ConflictDelegate interface { 8 | // NotifyConflict is invoked when a name conflict is detected 9 | NotifyConflict(existing, other *Node) 10 | } 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/xattrs_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | // Lgetxattr is not supported on platforms other than linux. 6 | func Lgetxattr(path string, attr string) ([]byte, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | 10 | // Lsetxattr is not supported on platforms other than linux. 11 | func Lsetxattr(path string, attr string, data []byte, flags int) error { 12 | return ErrNotSupportedPlatform 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/util_test.go: -------------------------------------------------------------------------------- 1 | package zk 2 | 3 | import "testing" 4 | 5 | func TestFormatServers(t *testing.T) { 6 | servers := []string{"127.0.0.1:2181", "127.0.0.42", "127.0.42.1:8811"} 7 | r := []string{"127.0.0.1:2181", "127.0.0.42:2181", "127.0.42.1:8811"} 8 | 9 | var s []string 10 | s = FormatServers(servers) 11 | 12 | for i := range s { 13 | if s[i] != r[i] { 14 | t.Errorf("%v should equal %v", s[i], r[i]) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_freebsd.go: -------------------------------------------------------------------------------- 1 | /* 2 | Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin. 3 | */ 4 | package logrus 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | 12 | type Termios struct { 13 | Iflag uint32 14 | Oflag uint32 15 | Cflag uint32 16 | Lflag uint32 17 | Cc [20]uint8 18 | Ispeed uint32 19 | Ospeed uint32 20 | } 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/signal/signal_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package signal 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Signals used in api/client (no windows equivalent, use 10 | // invalid signals so they don't get handled) 11 | const ( 12 | SIGCHLD = syscall.Signal(0xff) 13 | SIGWINCH = syscall.Signal(0xff) 14 | // DefaultStopSignal is the syscall signal used to stop a container in windows systems. 15 | DefaultStopSignal = "15" 16 | ) 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/lstat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Lstat takes a path to a file and returns 10 | // a system.StatT type pertaining to that file. 11 | // 12 | // Throws an error if the file does not exist 13 | func Lstat(path string) (*StatT, error) { 14 | s := &syscall.Stat_t{} 15 | if err := syscall.Lstat(path, s); err != nil { 16 | return nil, err 17 | } 18 | return fromStatT(s) 19 | } 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/homedir.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "os" 5 | "sync" 6 | ) 7 | 8 | var ( 9 | homeDir string 10 | homeDirLock sync.Mutex 11 | ) 12 | 13 | func getHomeDir() string { 14 | homeDirLock.Lock() 15 | defer homeDirLock.Unlock() 16 | 17 | if homeDir != "" { 18 | return homeDir 19 | } 20 | 21 | homeDir = os.Getenv("HOME") 22 | if homeDir != "" { 23 | return homeDir 24 | } 25 | 26 | homeDir = lookupHomeDir() 27 | return homeDir 28 | } 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/devices/devices_windows.go: -------------------------------------------------------------------------------- 1 | package devices 2 | 3 | import ( 4 | "github.com/opencontainers/runc/libcontainer/configs" 5 | ) 6 | 7 | // TODO Windows. This can be factored out further - Devices are not supported 8 | // by Windows Containers. 9 | 10 | func DeviceFromPath(path, permissions string) (*configs.Device, error) { 11 | return nil, nil 12 | } 13 | 14 | func HostDevices() ([]*configs.Device, error) { 15 | return nil, nil 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/script/travis_consul.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -gt 0 ] ; then 4 | CONSUL_VERSION="$1" 5 | else 6 | CONSUL_VERSION="0.5.2" 7 | fi 8 | 9 | # install consul 10 | wget "https://dl.bintray.com/mitchellh/consul/${CONSUL_VERSION}_linux_amd64.zip" 11 | unzip "${CONSUL_VERSION}_linux_amd64.zip" 12 | 13 | # make config for minimum ttl 14 | touch config.json 15 | echo "{\"session_ttl_min\": \"1s\"}" >> config.json 16 | 17 | # check 18 | ./consul --version 19 | -------------------------------------------------------------------------------- /drivers/bridge/netlink_deprecated_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package bridge 4 | 5 | import ( 6 | "errors" 7 | "net" 8 | ) 9 | 10 | // Add a slave to a bridge device. This is more backward-compatible than 11 | // netlink.NetworkSetMaster and works on RHEL 6. 12 | func ioctlAddToBridge(iface, master *net.Interface) error { 13 | return errors.New("not implemented") 14 | } 15 | 16 | func ioctlCreateBridge(name string, setMacAddr bool) error { 17 | return errors.New("not implemented") 18 | } 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/meminfo.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // MemInfo contains memory statistics of the host system. 4 | type MemInfo struct { 5 | // Total usable RAM (i.e. physical RAM minus a few reserved bits and the 6 | // kernel binary code). 7 | MemTotal int64 8 | 9 | // Amount of free memory. 10 | MemFree int64 11 | 12 | // Total amount of swap space available. 13 | SwapTotal int64 14 | 15 | // Amount of swap space that is currently unused. 16 | SwapFree int64 17 | } 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/utimes_darwin.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | // LUtimesNano is not supported by darwin platform. 6 | func LUtimesNano(path string, ts []syscall.Timespec) error { 7 | return ErrNotSupportedPlatform 8 | } 9 | 10 | // UtimesNano is used to change access and modification time of path. 11 | // it can't be used for symbol link file. 12 | func UtimesNano(path string, ts []syscall.Timespec) error { 13 | return syscall.UtimesNano(path, ts) 14 | } 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/console_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build freebsd 2 | 3 | package libcontainer 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | // newConsole returns an initalized console that can be used within a container by copying bytes 10 | // from the master side to the slave that is attached as the tty for the container's init process. 11 | func newConsole(uid, gid int) (Console, error) { 12 | return nil, errors.New("libcontainer console is not supported on FreeBSD") 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/codegangsta/cli/autocomplete/bash_autocomplete: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | : ${PROG:=$(basename ${BASH_SOURCE})} 4 | 5 | _cli_bash_autocomplete() { 6 | local cur prev opts base 7 | COMPREPLY=() 8 | cur="${COMP_WORDS[COMP_CWORD]}" 9 | prev="${COMP_WORDS[COMP_CWORD-1]}" 10 | opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) 11 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) 12 | return 0 13 | } 14 | 15 | complete -F _cli_bash_autocomplete $PROG -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/ioutils/fmt_test.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import "testing" 4 | 5 | func TestFprintfIfNotEmpty(t *testing.T) { 6 | wc := NewWriteCounter(&NopWriter{}) 7 | n, _ := FprintfIfNotEmpty(wc, "foo%s", "") 8 | 9 | if wc.Count != 0 || n != 0 { 10 | t.Errorf("Wrong count: %v vs. %v vs. 0", wc.Count, n) 11 | } 12 | 13 | n, _ = FprintfIfNotEmpty(wc, "foo%s", "bar") 14 | if wc.Count != 6 || n != 6 { 15 | t.Errorf("Wrong count: %v vs. %v vs. 6", wc.Count, n) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/serf/serf/event_delegate.go: -------------------------------------------------------------------------------- 1 | package serf 2 | 3 | import ( 4 | "github.com/hashicorp/memberlist" 5 | ) 6 | 7 | type eventDelegate struct { 8 | serf *Serf 9 | } 10 | 11 | func (e *eventDelegate) NotifyJoin(n *memberlist.Node) { 12 | e.serf.handleNodeJoin(n) 13 | } 14 | 15 | func (e *eventDelegate) NotifyLeave(n *memberlist.Node) { 16 | e.serf.handleNodeLeave(n) 17 | } 18 | 19 | func (e *eventDelegate) NotifyUpdate(n *memberlist.Node) { 20 | e.serf.handleNodeUpdate(n) 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/coreos/etcd/client/cancelreq_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // borrowed from golang/net/context/ctxhttp/cancelreq_go14.go 6 | 7 | // +build !go1.5 8 | 9 | package client 10 | 11 | import "net/http" 12 | 13 | func requestCanceler(tr CancelableTransport, req *http.Request) func() { 14 | return func() { 15 | tr.CancelRequest(req) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen_test.go: -------------------------------------------------------------------------------- 1 | //+build x,codecgen 2 | 3 | package codec 4 | 5 | import ( 6 | "fmt" 7 | "testing" 8 | ) 9 | 10 | func TestCodecgenJson1(t *testing.T) { 11 | const callCodecgenDirect bool = true 12 | v := newTestStruc(2, false, !testSkipIntf, false) 13 | var bs []byte 14 | e := NewEncoderBytes(&bs, testJsonH) 15 | if callCodecgenDirect { 16 | v.CodecEncodeSelf(e) 17 | e.w.atEndOfEncode() 18 | } else { 19 | e.MustEncode(v) 20 | } 21 | fmt.Printf("%s\n", bs) 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/conn_darwin.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "errors" 5 | "os/exec" 6 | ) 7 | 8 | func sessionBusPlatform() (*Conn, error) { 9 | cmd := exec.Command("launchctl", "getenv", "DBUS_LAUNCHD_SESSION_BUS_SOCKET") 10 | b, err := cmd.CombinedOutput() 11 | 12 | if err != nil { 13 | return nil, err 14 | } 15 | 16 | if len(b) == 0 { 17 | return nil, errors.New("dbus: couldn't determine address of session bus") 18 | } 19 | 20 | return Dial("unix:path=" + string(b[:len(b)-1])) 21 | } 22 | -------------------------------------------------------------------------------- /docs/bridge.md: -------------------------------------------------------------------------------- 1 | Bridge Driver 2 | ============= 3 | 4 | The bridge driver is an implementation that uses Linux Bridging and iptables to provide connectivity for containers 5 | It creates a single bridge, called `docker0` by default, and attaches a `veth pair` between the bridge and every endpoint. 6 | 7 | ## Configuration 8 | 9 | The bridge driver supports configuration through the Docker Daemon flags. 10 | 11 | ## Usage 12 | 13 | This driver is supported for the default "bridge" network only and it cannot be used for any other networks. 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netlink/neigh.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Neigh represents a link layer neighbor from netlink. 9 | type Neigh struct { 10 | LinkIndex int 11 | Family int 12 | State int 13 | Type int 14 | Flags int 15 | IP net.IP 16 | HardwareAddr net.HardwareAddr 17 | } 18 | 19 | // String returns $ip/$hwaddr $label 20 | func (neigh *Neigh) String() string { 21 | return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr) 22 | } 23 | -------------------------------------------------------------------------------- /drivers_linux.go: -------------------------------------------------------------------------------- 1 | package libnetwork 2 | 3 | import ( 4 | "github.com/docker/libnetwork/drivers/bridge" 5 | "github.com/docker/libnetwork/drivers/host" 6 | "github.com/docker/libnetwork/drivers/null" 7 | "github.com/docker/libnetwork/drivers/overlay" 8 | "github.com/docker/libnetwork/drivers/remote" 9 | ) 10 | 11 | func getInitializers() []initializer { 12 | return []initializer{ 13 | {bridge.Init, "bridge"}, 14 | {host.Init, "host"}, 15 | {null.Init, "null"}, 16 | {remote.Init, "remote"}, 17 | {overlay.Init, "overlay"}, 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/term/tc_other.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !linux !cgo 3 | 4 | package term 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | func tcget(fd uintptr, p *Termios) syscall.Errno { 12 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) 13 | return err 14 | } 15 | 16 | func tcset(fd uintptr, p *Termios) syscall.Errno { 17 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows 2 | 3 | package configs 4 | 5 | func (n *Namespace) Syscall() int { 6 | panic("No namespace syscall support") 7 | return 0 8 | } 9 | 10 | // CloneFlags parses the container's Namespaces options to set the correct 11 | // flags on clone, unshare. This functions returns flags only for new namespaces. 12 | func (n *Namespaces) CloneFlags() uintptr { 13 | panic("No namespace syscall support") 14 | return uintptr(0) 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/user/lookup_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 2 | 3 | package user 4 | 5 | import "io" 6 | 7 | func GetPasswdPath() (string, error) { 8 | return "", ErrUnsupported 9 | } 10 | 11 | func GetPasswd() (io.ReadCloser, error) { 12 | return nil, ErrUnsupported 13 | } 14 | 15 | func GetGroupPath() (string, error) { 16 | return "", ErrUnsupported 17 | } 18 | 19 | func GetGroup() (io.ReadCloser, error) { 20 | return nil, ErrUnsupported 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/codegangsta/cli/helpers_test.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | /* Test Helpers */ 9 | func expect(t *testing.T, a interface{}, b interface{}) { 10 | if a != b { 11 | t.Errorf("Expected %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a)) 12 | } 13 | } 14 | 15 | func refute(t *testing.T, a interface{}, b interface{}) { 16 | if a == b { 17 | t.Errorf("Did not expect %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a)) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/utimes_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd,!darwin 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // LUtimesNano is not supported on platforms other than linux, freebsd and darwin. 8 | func LUtimesNano(path string, ts []syscall.Timespec) error { 9 | return ErrNotSupportedPlatform 10 | } 11 | 12 | // UtimesNano is not supported on platforms other than linux, freebsd and darwin. 13 | func UtimesNano(path string, ts []syscall.Timespec) error { 14 | return ErrNotSupportedPlatform 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/coreos/etcd/client/cancelreq.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // borrowed from golang/net/context/ctxhttp/cancelreq.go 6 | 7 | // +build go1.5 8 | 9 | package client 10 | 11 | import "net/http" 12 | 13 | func requestCanceler(tr CancelableTransport, req *http.Request) func() { 14 | ch := make(chan struct{}) 15 | req.Cancel = ch 16 | 17 | return func() { 18 | close(ch) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /drivers/bridge/setup_firewalld.go: -------------------------------------------------------------------------------- 1 | package bridge 2 | 3 | import "github.com/docker/libnetwork/iptables" 4 | 5 | func (n *bridgeNetwork) setupFirewalld(config *networkConfiguration, i *bridgeInterface) error { 6 | d := n.driver 7 | d.Lock() 8 | driverConfig := d.config 9 | d.Unlock() 10 | 11 | // Sanity check. 12 | if driverConfig.EnableIPTables == false { 13 | return IPTableCfgError(config.BridgeName) 14 | } 15 | 16 | iptables.OnReloaded(func() { n.setupIPTables(config, i) }) 17 | iptables.OnReloaded(n.portMapper.ReMapAll) 18 | 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | integration-tmp/ 8 | _obj 9 | _test 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | *.cgo1.go 16 | *.cgo2.c 17 | _cgo_defun.c 18 | _cgo_gotypes.go 19 | _cgo_export.* 20 | 21 | _testmain.go 22 | 23 | *.exe 24 | *.test 25 | *.prof 26 | cmd/dnet/dnet 27 | 28 | # Coverage 29 | *.tmp 30 | *.coverprofile 31 | 32 | # IDE files and folders 33 | .project 34 | .settings/ 35 | 36 | libnetwork-build.created 37 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/filesys.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | // MkdirAll creates a directory named path along with any necessary parents, 11 | // with permission specified by attribute perm for all dir created. 12 | func MkdirAll(path string, perm os.FileMode) error { 13 | return os.MkdirAll(path, perm) 14 | } 15 | 16 | // IsAbs is a platform-specific wrapper for filepath.IsAbs. 17 | func IsAbs(path string) bool { 18 | return filepath.IsAbs(path) 19 | } 20 | -------------------------------------------------------------------------------- /resolvconf/dns/resolvconf.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import ( 4 | "regexp" 5 | ) 6 | 7 | // IPLocalhost is a regex patter for localhost IP address range. 8 | const IPLocalhost = `((127\.([0-9]{1,3}\.){2}[0-9]{1,3})|(::1))` 9 | 10 | var localhostIPRegexp = regexp.MustCompile(IPLocalhost) 11 | 12 | // IsLocalhost returns true if ip matches the localhost IP regular expression. 13 | // Used for determining if nameserver settings are being passed which are 14 | // localhost addresses 15 | func IsLocalhost(ip string) bool { 16 | return localhostIPRegexp.MatchString(ip) 17 | } 18 | -------------------------------------------------------------------------------- /drivers/bridge/labels.go: -------------------------------------------------------------------------------- 1 | package bridge 2 | 3 | const ( 4 | // BridgeName label for bridge driver 5 | BridgeName = "com.docker.network.bridge.name" 6 | 7 | // EnableIPMasquerade label for bridge driver 8 | EnableIPMasquerade = "com.docker.network.bridge.enable_ip_masquerade" 9 | 10 | // EnableICC label 11 | EnableICC = "com.docker.network.bridge.enable_icc" 12 | 13 | // DefaultBindingIP label 14 | DefaultBindingIP = "com.docker.network.bridge.host_binding_ipv4" 15 | 16 | // DefaultBridge label 17 | DefaultBridge = "com.docker.network.bridge.default_bridge" 18 | ) 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/homedir/homedir_test.go: -------------------------------------------------------------------------------- 1 | package homedir 2 | 3 | import ( 4 | "path/filepath" 5 | "testing" 6 | ) 7 | 8 | func TestGet(t *testing.T) { 9 | home := Get() 10 | if home == "" { 11 | t.Fatal("returned home directory is empty") 12 | } 13 | 14 | if !filepath.IsAbs(home) { 15 | t.Fatalf("returned path is not absolute: %s", home) 16 | } 17 | } 18 | 19 | func TestGetShortcutString(t *testing.T) { 20 | shortcut := GetShortcutString() 21 | if shortcut == "" { 22 | t.Fatal("returned shortcut string is empty") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/syndtr/gocapability/capability/capability_noop.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | // +build !linux 8 | 9 | package capability 10 | 11 | import "errors" 12 | 13 | func newPid(pid int) (Capabilities, error) { 14 | return nil, errors.New("not supported") 15 | } 16 | 17 | func newFile(path string) (Capabilities, error) { 18 | return nil, errors.New("not supported") 19 | } 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/ioutils/fmt.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | // FprintfIfNotEmpty prints the string value if it's not empty 9 | func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) { 10 | if value != "" { 11 | return fmt.Fprintf(w, format, value) 12 | } 13 | return 0, nil 14 | } 15 | 16 | // FprintfIfTrue prints the boolean value if it's true 17 | func FprintfIfTrue(w io.Writer, format string, ok bool) (int, error) { 18 | if ok { 19 | return fmt.Fprintf(w, format, ok) 20 | } 21 | return 0, nil 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/conn_other.go: -------------------------------------------------------------------------------- 1 | // +build !darwin 2 | 3 | package dbus 4 | 5 | import ( 6 | "bytes" 7 | "errors" 8 | "os/exec" 9 | ) 10 | 11 | func sessionBusPlatform() (*Conn, error) { 12 | cmd := exec.Command("dbus-launch") 13 | b, err := cmd.CombinedOutput() 14 | 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | i := bytes.IndexByte(b, '=') 20 | j := bytes.IndexByte(b, '\n') 21 | 22 | if i == -1 || j == -1 { 23 | return nil, errors.New("dbus: couldn't determine address of session bus") 24 | } 25 | 26 | return Dial(string(b[i+1 : j])) 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/syslog/README.md: -------------------------------------------------------------------------------- 1 | # Syslog Hooks for Logrus :walrus: 2 | 3 | ## Usage 4 | 5 | ```go 6 | import ( 7 | "log/syslog" 8 | "github.com/Sirupsen/logrus" 9 | logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" 10 | ) 11 | 12 | func main() { 13 | log := logrus.New() 14 | hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 15 | 16 | if err == nil { 17 | log.Hooks.Add(hook) 18 | } 19 | } 20 | ``` 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/libkv_test.go: -------------------------------------------------------------------------------- 1 | package libkv 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | "github.com/docker/libkv/store" 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | func TestNewStoreUnsupported(t *testing.T) { 12 | client := "localhost:9999" 13 | 14 | kv, err := NewStore( 15 | "unsupported", 16 | []string{client}, 17 | &store.Config{ 18 | ConnectionTimeout: 10 * time.Second, 19 | }, 20 | ) 21 | assert.Error(t, err) 22 | assert.Nil(t, kv) 23 | assert.Equal(t, "Backend storage not supported yet, please choose one of ", err.Error()) 24 | } 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/system/sysconfig_notcgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo windows 2 | 3 | package system 4 | 5 | func GetClockTicks() int { 6 | // TODO figure out a better alternative for platforms where we're missing cgo 7 | // 8 | // TODO Windows. This could be implemented using Win32 QueryPerformanceFrequency(). 9 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx 10 | // 11 | // An example of its usage can be found here. 12 | // https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx 13 | 14 | return 100 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/reexec/command_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build freebsd 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Self returns the path to the current process's binary. 10 | // Uses os.Args[0]. 11 | func Self() string { 12 | return naiveSelf() 13 | } 14 | 15 | // Command returns *exec.Cmd which have Path as current binary. 16 | // For example if current binary is "docker" at "/usr/bin/", then cmd.Path will 17 | // be set to "/usr/bin/docker". 18 | func Command(args ...string) *exec.Cmd { 19 | return &exec.Cmd{ 20 | Path: Self(), 21 | Args: args, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/reexec/command_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Self returns the path to the current process's binary. 10 | // Uses os.Args[0]. 11 | func Self() string { 12 | return naiveSelf() 13 | } 14 | 15 | // Command returns *exec.Cmd which have Path as current binary. 16 | // For example if current binary is "docker.exe" at "C:\", then cmd.Path will 17 | // be set to "C:\docker.exe". 18 | func Command(args ...string) *exec.Cmd { 19 | return &exec.Cmd{ 20 | Path: Self(), 21 | Args: args, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/swarm/pkg/store/etcd_test.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | ) 7 | 8 | func makeEtcdClient(t *testing.T) Store { 9 | client := "localhost:4001" 10 | 11 | kv, err := NewStore( 12 | ETCD, 13 | []string{client}, 14 | &Config{ 15 | ConnectionTimeout: 3 * time.Second, 16 | EphemeralTTL: 2 * time.Second, 17 | }, 18 | ) 19 | if err != nil { 20 | t.Fatalf("cannot create store: %v", err) 21 | } 22 | 23 | return kv 24 | } 25 | 26 | func TestEtcdStore(t *testing.T) { 27 | kv := makeEtcdClient(t) 28 | 29 | testStore(t, kv) 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/swarm/pkg/store/zookeeper_test.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | ) 7 | 8 | func makeZkClient(t *testing.T) Store { 9 | client := "localhost:2181" 10 | 11 | kv, err := NewStore( 12 | ZK, 13 | []string{client}, 14 | &Config{ 15 | ConnectionTimeout: 3 * time.Second, 16 | EphemeralTTL: 2 * time.Second, 17 | }, 18 | ) 19 | if err != nil { 20 | t.Fatalf("cannot create store: %v", err) 21 | } 22 | 23 | return kv 24 | } 25 | 26 | func TestZkStore(t *testing.T) { 27 | kv := makeZkClient(t) 28 | 29 | testStore(t, kv) 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md: -------------------------------------------------------------------------------- 1 | # Implements the TOML test suite interface 2 | 3 | This is an implementation of the interface expected by 4 | [toml-test](https://github.com/BurntSushi/toml-test) for my 5 | [toml parser written in Go](https://github.com/BurntSushi/toml). 6 | In particular, it maps TOML data on `stdin` to a JSON format on `stdout`. 7 | 8 | 9 | Compatible with TOML version 10 | [v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md) 11 | 12 | Compatible with `toml-test` version 13 | [v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0) 14 | 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/memberlist/merge_delegate.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | // MergeDelegate is used to involve a client in 4 | // a potential cluster merge operation. Namely, when 5 | // a node does a TCP push/pull (as part of a join), 6 | // the delegate is involved and allowed to cancel the join 7 | // based on custom logic. The merge delegate is NOT invoked 8 | // as part of the push-pull anti-entropy. 9 | type MergeDelegate interface { 10 | // NotifyMerge is invoked when a merge could take place. 11 | // Provides a list of the nodes known by the peer. 12 | NotifyMerge(peers []*Node) (cancel bool) 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/mux/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package mux 6 | 7 | import ( 8 | "net/http" 9 | "testing" 10 | ) 11 | 12 | func BenchmarkMux(b *testing.B) { 13 | router := new(Router) 14 | handler := func(w http.ResponseWriter, r *http.Request) {} 15 | router.HandleFunc("/v1/{v1}", handler) 16 | 17 | request, _ := http.NewRequest("GET", "/v1/anything", nil) 18 | for i := 0; i < b.N; i++ { 19 | router.ServeHTTP(nil, request) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md: -------------------------------------------------------------------------------- 1 | # Implements the TOML test suite interface for TOML encoders 2 | 3 | This is an implementation of the interface expected by 4 | [toml-test](https://github.com/BurntSushi/toml-test) for the 5 | [TOML encoder](https://github.com/BurntSushi/toml). 6 | In particular, it maps JSON data on `stdin` to a TOML format on `stdout`. 7 | 8 | 9 | Compatible with TOML version 10 | [v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md) 11 | 12 | Compatible with `toml-test` version 13 | [v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0) 14 | 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/papertrail/papertrail_test.go: -------------------------------------------------------------------------------- 1 | package logrus_papertrail 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/Sirupsen/logrus" 8 | "github.com/stvp/go-udp-testing" 9 | ) 10 | 11 | func TestWritingToUDP(t *testing.T) { 12 | port := 16661 13 | udp.SetAddr(fmt.Sprintf(":%d", port)) 14 | 15 | hook, err := NewPapertrailHook("localhost", port, "test") 16 | if err != nil { 17 | t.Errorf("Unable to connect to local UDP server.") 18 | } 19 | 20 | log := logrus.New() 21 | log.Hooks.Add(hook) 22 | 23 | udp.ShouldReceive(t, "foo", func() { 24 | log.Info("foo") 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/cgroups_test.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package cgroups 4 | 5 | import ( 6 | "bytes" 7 | "testing" 8 | ) 9 | 10 | const ( 11 | cgroupsContents = `11:hugetlb:/ 12 | 10:perf_event:/ 13 | 9:blkio:/ 14 | 8:net_cls:/ 15 | 7:freezer:/ 16 | 6:devices:/ 17 | 5:memory:/ 18 | 4:cpuacct,cpu:/ 19 | 3:cpuset:/ 20 | 2:name=systemd:/user.slice/user-1000.slice/session-16.scope` 21 | ) 22 | 23 | func TestParseCgroups(t *testing.T) { 24 | r := bytes.NewBuffer([]byte(cgroupsContents)) 25 | _, err := ParseCgroupFile("blkio", r) 26 | if err != nil { 27 | t.Fatal(err) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/hack/validate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # This script runs all validations 5 | 6 | validate() { 7 | export MAKEDIR=/go/src/github.com/docker/docker/hack/make 8 | sed -i 's!docker/docker!opencontainers/runc/libcontainer!' /go/src/github.com/docker/docker/hack/make/.validate 9 | bash /go/src/github.com/docker/docker/hack/make/validate-dco 10 | bash /go/src/github.com/docker/docker/hack/make/validate-gofmt 11 | go get golang.org/x/tools/cmd/vet 12 | bash /go/src/github.com/docker/docker/hack/make/validate-vet 13 | } 14 | 15 | # run validations 16 | validate 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants_test.go: -------------------------------------------------------------------------------- 1 | package zk 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestModeString(t *testing.T) { 9 | if fmt.Sprintf("%v", ModeUnknown) != "unknown" { 10 | t.Errorf("unknown value should be 'unknown'") 11 | } 12 | 13 | if fmt.Sprintf("%v", ModeLeader) != "leader" { 14 | t.Errorf("leader value should be 'leader'") 15 | } 16 | 17 | if fmt.Sprintf("%v", ModeFollower) != "follower" { 18 | t.Errorf("follower value should be 'follower'") 19 | } 20 | 21 | if fmt.Sprintf("%v", ModeStandalone) != "standalone" { 22 | t.Errorf("standlone value should be 'standalone'") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /osl/sandbox_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd 2 | 3 | package osl 4 | 5 | import "errors" 6 | 7 | var ( 8 | // ErrNotImplemented is for platforms which don't implement sandbox 9 | ErrNotImplemented = errors.New("not implemented") 10 | ) 11 | 12 | // NewSandbox provides a new sandbox instance created in an os specific way 13 | // provided a key which uniquely identifies the sandbox 14 | func NewSandbox(key string, osCreate bool) (Sandbox, error) { 15 | return nil, ErrNotImplemented 16 | } 17 | 18 | // GenerateKey generates a sandbox key based on the passed 19 | // container id. 20 | func GenerateKey(containerID string) string { 21 | return "" 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/script/coverage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MODE="mode: count" 4 | ROOT=${TRAVIS_BUILD_DIR:-.}/../../.. 5 | 6 | # Grab the list of packages. 7 | # Exclude the API and CLI from coverage as it will be covered by integration tests. 8 | PACKAGES=`go list ./...` 9 | 10 | # Create the empty coverage file. 11 | echo $MODE > goverage.report 12 | 13 | # Run coverage on every package. 14 | for package in $PACKAGES; do 15 | output="$ROOT/$package/coverage.out" 16 | 17 | go test -test.short -covermode=count -coverprofile=$output $package 18 | if [ -f "$output" ] ; then 19 | cat "$output" | grep -v "$MODE" >> goverage.report 20 | fi 21 | done 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/serf/serf/broadcast.go: -------------------------------------------------------------------------------- 1 | package serf 2 | 3 | import ( 4 | "github.com/hashicorp/memberlist" 5 | ) 6 | 7 | // broadcast is an implementation of memberlist.Broadcast and is used 8 | // to manage broadcasts across the memberlist channel that are related 9 | // only to Serf. 10 | type broadcast struct { 11 | msg []byte 12 | notify chan<- struct{} 13 | } 14 | 15 | func (b *broadcast) Invalidates(other memberlist.Broadcast) bool { 16 | return false 17 | } 18 | 19 | func (b *broadcast) Message() []byte { 20 | return b.msg 21 | } 22 | 23 | func (b *broadcast) Finished() { 24 | if b.notify != nil { 25 | close(b.notify) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/system/syscall_linux_386.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/system/syscall_linux_arm.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID32, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /drivers/bridge/setup.go: -------------------------------------------------------------------------------- 1 | package bridge 2 | 3 | type setupStep func(*networkConfiguration, *bridgeInterface) error 4 | 5 | type bridgeSetup struct { 6 | config *networkConfiguration 7 | bridge *bridgeInterface 8 | steps []setupStep 9 | } 10 | 11 | func newBridgeSetup(c *networkConfiguration, i *bridgeInterface) *bridgeSetup { 12 | return &bridgeSetup{config: c, bridge: i} 13 | } 14 | 15 | func (b *bridgeSetup) apply() error { 16 | for _, fn := range b.steps { 17 | if err := fn(b.config, b.bridge); err != nil { 18 | return err 19 | } 20 | } 21 | return nil 22 | } 23 | 24 | func (b *bridgeSetup) queueStep(step setupStep) { 25 | b.steps = append(b.steps, step) 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mounter_linux.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | func mount(device, target, mType string, flag uintptr, data string) error { 8 | if err := syscall.Mount(device, target, mType, flag, data); err != nil { 9 | return err 10 | } 11 | 12 | // If we have a bind mount or remount, remount... 13 | if flag&syscall.MS_BIND == syscall.MS_BIND && flag&syscall.MS_RDONLY == syscall.MS_RDONLY { 14 | return syscall.Mount(device, target, mType, flag|syscall.MS_REMOUNT, data) 15 | } 16 | return nil 17 | } 18 | 19 | func unmount(target string, flag int) error { 20 | return syscall.Unmount(target, flag) 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd freebsd,!cgo 2 | 3 | package mount 4 | 5 | // These flags are unsupported. 6 | const ( 7 | BIND = 0 8 | DIRSYNC = 0 9 | MANDLOCK = 0 10 | NOATIME = 0 11 | NODEV = 0 12 | NODIRATIME = 0 13 | NOEXEC = 0 14 | NOSUID = 0 15 | UNBINDABLE = 0 16 | RUNBINDABLE = 0 17 | PRIVATE = 0 18 | RPRIVATE = 0 19 | SHARED = 0 20 | RSHARED = 0 21 | SLAVE = 0 22 | RSLAVE = 0 23 | RBIND = 0 24 | RELATIME = 0 25 | RELATIVE = 0 26 | REMOUNT = 0 27 | STRICTATIME = 0 28 | SYNCHRONOUS = 0 29 | RDONLY = 0 30 | ) 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/error_test.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | import "testing" 4 | 5 | func TestErrorCode(t *testing.T) { 6 | codes := map[ErrorCode]string{ 7 | IdInUse: "Id already in use", 8 | InvalidIdFormat: "Invalid format", 9 | ContainerPaused: "Container paused", 10 | ConfigInvalid: "Invalid configuration", 11 | SystemError: "System error", 12 | ContainerNotExists: "Container does not exist", 13 | } 14 | 15 | for code, expected := range codes { 16 | if actual := code.String(); actual != expected { 17 | t.Fatalf("expected string %q but received %q", expected, actual) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | 14 | // AlwaysFalse is here to stay false 15 | // (and be exported so the compiler doesn't optimize out its reference) 16 | var AlwaysFalse bool 17 | 18 | func init() { 19 | if AlwaysFalse { 20 | // by referencing this C init() in a noop test, it will ensure the compiler 21 | // links in the C function. 22 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 23 | C.init() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md: -------------------------------------------------------------------------------- 1 | # TOML Validator 2 | 3 | If Go is installed, it's simple to try it out: 4 | 5 | ```bash 6 | go get github.com/BurntSushi/toml/cmd/tomlv 7 | tomlv some-toml-file.toml 8 | ``` 9 | 10 | You can see the types of every key in a TOML file with: 11 | 12 | ```bash 13 | tomlv -types some-toml-file.toml 14 | ``` 15 | 16 | At the moment, only one error message is reported at a time. Error messages 17 | include line numbers. No output means that the files given are valid TOML, or 18 | there is a bug in `tomlv`. 19 | 20 | Compatible with TOML version 21 | [v0.1.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.1.0.md) 22 | 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/memberlist/test/setup_subnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script makes sure that 127.0.0.x is routable. On Darwin, there 4 | # is a bug that it isn't routable and this causes errors. 5 | # 6 | 7 | # Check if loopback is setup 8 | ping -c 1 -W 10 127.0.0.2 > /dev/null 2>&1 9 | if [ $? -eq 0 ] 10 | then 11 | exit 12 | fi 13 | 14 | # If we're not on OS X, then error 15 | case $OSTYPE in 16 | darwin*) 17 | ;; 18 | *) 19 | echo "Can't setup interfaces on non-Mac. Error!" 20 | exit 1 21 | ;; 22 | esac 23 | 24 | # Setup loopback 25 | for ((i=2;i<256;i++)) 26 | do 27 | sudo ifconfig lo0 alias 127.0.0.$i up 28 | done 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/utils/utils_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import "testing" 4 | 5 | func TestGenerateName(t *testing.T) { 6 | name, err := GenerateRandomName("veth", 5) 7 | if err != nil { 8 | t.Fatal(err) 9 | } 10 | 11 | expected := 5 + len("veth") 12 | if len(name) != expected { 13 | t.Fatalf("expected name to be %d chars but received %d", expected, len(name)) 14 | } 15 | 16 | name, err = GenerateRandomName("veth", 65) 17 | if err != nil { 18 | t.Fatal(err) 19 | } 20 | 21 | expected = 64 + len("veth") 22 | if len(name) != expected { 23 | t.Fatalf("expected name to be %d chars but received %d", expected, len(name)) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/signal/signal_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package signal 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Signals used in api/client (no windows equivalent, use 10 | // invalid signals so they don't get handled) 11 | 12 | const ( 13 | // SIGCHLD is a signal sent to a process when a child process terminates, is interrupted, or resumes after being interrupted. 14 | SIGCHLD = syscall.SIGCHLD 15 | // SIGWINCH is a signal sent to a process when its controlling terminal changes its size 16 | SIGWINCH = syscall.SIGWINCH 17 | // DefaultStopSignal is the syscall signal used to stop a container in unix systems. 18 | DefaultStopSignal = "SIGTERM" 19 | ) 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/serf/serf/lamport_test.go: -------------------------------------------------------------------------------- 1 | package serf 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestLamportClock(t *testing.T) { 8 | l := &LamportClock{} 9 | 10 | if l.Time() != 0 { 11 | t.Fatalf("bad time value") 12 | } 13 | 14 | if l.Increment() != 1 { 15 | t.Fatalf("bad time value") 16 | } 17 | 18 | if l.Time() != 1 { 19 | t.Fatalf("bad time value") 20 | } 21 | 22 | l.Witness(41) 23 | 24 | if l.Time() != 42 { 25 | t.Fatalf("bad time value") 26 | } 27 | 28 | l.Witness(41) 29 | 30 | if l.Time() != 42 { 31 | t.Fatalf("bad time value") 32 | } 33 | 34 | l.Witness(30) 35 | 36 | if l.Time() != 42 { 37 | t.Fatalf("bad time value") 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /hostdiscovery/hostdiscovery_api.go: -------------------------------------------------------------------------------- 1 | package hostdiscovery 2 | 3 | import "net" 4 | 5 | // JoinCallback provides a callback event for new node joining the cluster 6 | type JoinCallback func(entries []net.IP) 7 | 8 | // LeaveCallback provides a callback event for node leaving the cluster 9 | type LeaveCallback func(entries []net.IP) 10 | 11 | // HostDiscovery primary interface 12 | type HostDiscovery interface { 13 | //Watch Node join and leave cluster events 14 | Watch(joinCallback JoinCallback, leaveCallback LeaveCallback) error 15 | // StopDiscovery stops the discovery perocess 16 | StopDiscovery() error 17 | // Fetch returns a list of host IPs that are currently discovered 18 | Fetch() []net.IP 19 | } 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/bolt_openbsd.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | const ( 9 | msAsync = 1 << iota // perform asynchronous writes 10 | msSync // perform synchronous writes 11 | msInvalidate // invalidate cached data 12 | ) 13 | 14 | var odirect int 15 | 16 | func msync(db *DB) error { 17 | _, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate) 18 | if errno != 0 { 19 | return errno 20 | } 21 | return nil 22 | } 23 | 24 | func fdatasync(db *DB) error { 25 | if db.data != nil { 26 | return msync(db) 27 | } 28 | return db.file.Sync() 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/syslog/syslog_test.go: -------------------------------------------------------------------------------- 1 | package logrus_syslog 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "log/syslog" 6 | "testing" 7 | ) 8 | 9 | func TestLocalhostAddAndPrint(t *testing.T) { 10 | log := logrus.New() 11 | hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 12 | 13 | if err != nil { 14 | t.Errorf("Unable to connect to local syslog.") 15 | } 16 | 17 | log.Hooks.Add(hook) 18 | 19 | for _, level := range hook.Levels() { 20 | if len(log.Hooks[level]) != 1 { 21 | t.Errorf("SyslogHook was not added. The length of log.Hooks[%v]: %v", level, len(log.Hooks[level])) 22 | } 23 | } 24 | 25 | log.Info("Congratulations!") 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux,!appengine darwin freebsd openbsd 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | // IsTerminal returns true if the given file descriptor is a terminal. 16 | func IsTerminal() bool { 17 | fd := syscall.Stdout 18 | var termios Termios 19 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 20 | return err == 0 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/client.go: -------------------------------------------------------------------------------- 1 | // Package client provides a command-line interface for Docker. 2 | // 3 | // Run "docker help SUBCOMMAND" or "docker SUBCOMMAND --help" to see more information on any Docker subcommand, including the full list of options supported for the subcommand. 4 | // See https://docs.docker.com/installation/ for instructions on installing Docker. 5 | package client 6 | 7 | import "fmt" 8 | 9 | // An StatusError reports an unsuccessful exit by a command. 10 | type StatusError struct { 11 | Status string 12 | StatusCode int 13 | } 14 | 15 | func (e StatusError) Error() string { 16 | return fmt.Sprintf("Status: %s, Code: %d", e.Status, e.StatusCode) 17 | } 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/serf/serf/broadcast_test.go: -------------------------------------------------------------------------------- 1 | package serf 2 | 3 | import ( 4 | "github.com/hashicorp/memberlist" 5 | "testing" 6 | "time" 7 | ) 8 | 9 | func TestBroadcast_Impl(t *testing.T) { 10 | var _ memberlist.Broadcast = &broadcast{} 11 | } 12 | 13 | func TestBroadcastFinished(t *testing.T) { 14 | t.Parallel() 15 | 16 | ch := make(chan struct{}) 17 | b := &broadcast{notify: ch} 18 | b.Finished() 19 | 20 | select { 21 | case <-ch: 22 | case <-time.After(10 * time.Millisecond): 23 | t.Fatalf("should have notified") 24 | } 25 | } 26 | 27 | func TestBroadcastFinished_nilNotify(t *testing.T) { 28 | t.Parallel() 29 | 30 | b := &broadcast{notify: nil} 31 | b.Finished() 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | type JSONFormatter struct{} 10 | 11 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 12 | data := make(Fields, len(entry.Data)+3) 13 | for k, v := range entry.Data { 14 | data[k] = v 15 | } 16 | prefixFieldClashes(data) 17 | data["time"] = entry.Time.Format(time.RFC3339) 18 | data["msg"] = entry.Message 19 | data["level"] = entry.Level.String() 20 | 21 | serialized, err := json.Marshal(data) 22 | if err != nil { 23 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 24 | } 25 | return append(serialized, '\n'), nil 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/consul/api/status_test.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestStatusLeader(t *testing.T) { 8 | c, s := makeClient(t) 9 | defer s.stop() 10 | 11 | status := c.Status() 12 | 13 | leader, err := status.Leader() 14 | if err != nil { 15 | t.Fatalf("err: %v", err) 16 | } 17 | if leader == "" { 18 | t.Fatalf("Expected leader") 19 | } 20 | } 21 | 22 | func TestStatusPeers(t *testing.T) { 23 | c, s := makeClient(t) 24 | defer s.stop() 25 | 26 | status := c.Status() 27 | 28 | peers, err := status.Peers() 29 | if err != nil { 30 | t.Fatalf("err: %v", err) 31 | } 32 | if len(peers) == 0 { 33 | t.Fatalf("Expected peers ") 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/lstat_test.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | ) 7 | 8 | // TestLstat tests Lstat for existing and non existing files 9 | func TestLstat(t *testing.T) { 10 | file, invalid, _, dir := prepareFiles(t) 11 | defer os.RemoveAll(dir) 12 | 13 | statFile, err := Lstat(file) 14 | if err != nil { 15 | t.Fatal(err) 16 | } 17 | if statFile == nil { 18 | t.Fatal("returned empty stat for existing file") 19 | } 20 | 21 | statInvalid, err := Lstat(invalid) 22 | if err == nil { 23 | t.Fatal("did not return error for non-existing file") 24 | } 25 | if statInvalid != nil { 26 | t.Fatal("returned non-nil stat for non-existing file") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/lstat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // Lstat calls os.Lstat to get a fileinfo interface back. 10 | // This is then copied into our own locally defined structure. 11 | // Note the Linux version uses fromStatT to do the copy back, 12 | // but that not strictly necessary when already in an OS specific module. 13 | func Lstat(path string) (*StatT, error) { 14 | fi, err := os.Lstat(path) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return &StatT{ 20 | name: fi.Name(), 21 | size: fi.Size(), 22 | mode: fi.Mode(), 23 | modTime: fi.ModTime(), 24 | isDir: fi.IsDir()}, nil 25 | } 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stacktrace/frame_test.go: -------------------------------------------------------------------------------- 1 | package stacktrace 2 | 3 | import "testing" 4 | 5 | func TestParsePackageName(t *testing.T) { 6 | var ( 7 | name = "github.com/opencontainers/runc/libcontainer/stacktrace.captureFunc" 8 | expectedPackage = "github.com/opencontainers/runc/libcontainer/stacktrace" 9 | expectedFunction = "captureFunc" 10 | ) 11 | 12 | pack, funcName := parseFunctionName(name) 13 | if pack != expectedPackage { 14 | t.Fatalf("expected package %q but received %q", expectedPackage, pack) 15 | } 16 | 17 | if funcName != expectedFunction { 18 | t.Fatalf("expected function %q but received %q", expectedFunction, funcName) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/system/syscall_linux_64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 linux,amd64 linux,ppc linux,ppc64 linux,ppc64le linux,s390x 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 2 | 3 | package user 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // Unix-specific path to the passwd and group formatted files. 11 | const ( 12 | unixPasswdPath = "/etc/passwd" 13 | unixGroupPath = "/etc/group" 14 | ) 15 | 16 | func GetPasswdPath() (string, error) { 17 | return unixPasswdPath, nil 18 | } 19 | 20 | func GetPasswd() (io.ReadCloser, error) { 21 | return os.Open(unixPasswdPath) 22 | } 23 | 24 | func GetGroupPath() (string, error) { 25 | return unixGroupPath, nil 26 | } 27 | 28 | func GetGroup() (io.ReadCloser, error) { 29 | return os.Open(unixGroupPath) 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/auth_external.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "encoding/hex" 5 | ) 6 | 7 | // AuthExternal returns an Auth that authenticates as the given user with the 8 | // EXTERNAL mechanism. 9 | func AuthExternal(user string) Auth { 10 | return authExternal{user} 11 | } 12 | 13 | // AuthExternal implements the EXTERNAL authentication mechanism. 14 | type authExternal struct { 15 | user string 16 | } 17 | 18 | func (a authExternal) FirstData() ([]byte, []byte, AuthStatus) { 19 | b := make([]byte, 2*len(a.user)) 20 | hex.Encode(b, []byte(a.user)) 21 | return []byte("EXTERNAL"), b, AuthOk 22 | } 23 | 24 | func (a authExternal) HandleData(b []byte) ([]byte, AuthStatus) { 25 | return nil, AuthError 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/introspect/call.go: -------------------------------------------------------------------------------- 1 | package introspect 2 | 3 | import ( 4 | "encoding/xml" 5 | "github.com/godbus/dbus" 6 | "strings" 7 | ) 8 | 9 | // Call calls org.freedesktop.Introspectable.Introspect on a remote object 10 | // and returns the introspection data. 11 | func Call(o *dbus.Object) (*Node, error) { 12 | var xmldata string 13 | var node Node 14 | 15 | err := o.Call("org.freedesktop.DBus.Introspectable.Introspect", 0).Store(&xmldata) 16 | if err != nil { 17 | return nil, err 18 | } 19 | err = xml.NewDecoder(strings.NewReader(xmldata)).Decode(&node) 20 | if err != nil { 21 | return nil, err 22 | } 23 | if node.Name == "" { 24 | node.Name = string(o.Path()) 25 | } 26 | return &node, nil 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/writer.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bufio" 5 | "io" 6 | "runtime" 7 | ) 8 | 9 | func (logger *Logger) Writer() (*io.PipeWriter) { 10 | reader, writer := io.Pipe() 11 | 12 | go logger.writerScanner(reader) 13 | runtime.SetFinalizer(writer, writerFinalizer) 14 | 15 | return writer 16 | } 17 | 18 | func (logger *Logger) writerScanner(reader *io.PipeReader) { 19 | scanner := bufio.NewScanner(reader) 20 | for scanner.Scan() { 21 | logger.Print(scanner.Text()) 22 | } 23 | if err := scanner.Err(); err != nil { 24 | logger.Errorf("Error while reading from Writer: %s", err) 25 | } 26 | reader.Close() 27 | } 28 | 29 | func writerFinalizer(writer *io.PipeWriter) { 30 | writer.Close() 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/memberlist/broadcast_test.go: -------------------------------------------------------------------------------- 1 | package memberlist 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | func TestMemberlistBroadcast_Invalidates(t *testing.T) { 9 | m1 := &memberlistBroadcast{"test", nil, nil} 10 | m2 := &memberlistBroadcast{"foo", nil, nil} 11 | 12 | if m1.Invalidates(m2) || m2.Invalidates(m1) { 13 | t.Fatalf("unexpected invalidation") 14 | } 15 | 16 | if !m1.Invalidates(m1) { 17 | t.Fatalf("expected invalidation") 18 | } 19 | } 20 | 21 | func TestMemberlistBroadcast_Message(t *testing.T) { 22 | m1 := &memberlistBroadcast{"test", []byte("test"), nil} 23 | msg := m1.Message() 24 | if !reflect.DeepEqual(msg, []byte("test")) { 25 | t.Fatalf("messages do not match") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/stat_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtimespec}, nil 15 | } 16 | 17 | // Stat takes a path to a file and returns 18 | // a system.Stat_t type pertaining to that file. 19 | // 20 | // Throws an error if the file does not exist 21 | func Stat(path string) (*StatT, error) { 22 | s := &syscall.Stat_t{} 23 | if err := syscall.Stat(path, s); err != nil { 24 | return nil, err 25 | } 26 | return fromStatT(s) 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netns/netns_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netns 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | var ( 10 | ErrNotImplemented = errors.New("not implemented") 11 | ) 12 | 13 | func Set(ns NsHandle) (err error) { 14 | return ErrNotImplemented 15 | } 16 | 17 | func New() (ns NsHandle, err error) { 18 | return -1, ErrNotImplemented 19 | } 20 | 21 | func Get() (NsHandle, error) { 22 | return -1, ErrNotImplemented 23 | } 24 | 25 | func GetFromName(name string) (NsHandle, error) { 26 | return -1, ErrNotImplemented 27 | } 28 | 29 | func GetFromPid(pid int) (NsHandle, error) { 30 | return -1, ErrNotImplemented 31 | } 32 | 33 | func GetFromDocker(id string) (NsHandle, error) { 34 | return -1, ErrNotImplemented 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/console_windows.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | // newConsole returns an initalized console that can be used within a container 4 | func newConsole(uid, gid int) (Console, error) { 5 | return &windowsConsole{}, nil 6 | } 7 | 8 | // windowsConsole is a Windows psuedo TTY for use within a container. 9 | type windowsConsole struct { 10 | } 11 | 12 | func (c *windowsConsole) Fd() uintptr { 13 | return 0 14 | } 15 | 16 | func (c *windowsConsole) Path() string { 17 | return "" 18 | } 19 | 20 | func (c *windowsConsole) Read(b []byte) (int, error) { 21 | return 0, nil 22 | } 23 | 24 | func (c *windowsConsole) Write(b []byte) (int, error) { 25 | return 0, nil 26 | } 27 | 28 | func (c *windowsConsole) Close() error { 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/transport_unixcred_linux.go: -------------------------------------------------------------------------------- 1 | // The UnixCredentials system call is currently only implemented on Linux 2 | // http://golang.org/src/pkg/syscall/sockcmsg_linux.go 3 | // https://golang.org/s/go1.4-syscall 4 | // http://code.google.com/p/go/source/browse/unix/sockcmsg_linux.go?repo=sys 5 | 6 | package dbus 7 | 8 | import ( 9 | "io" 10 | "os" 11 | "syscall" 12 | ) 13 | 14 | func (t *unixTransport) SendNullByte() error { 15 | ucred := &syscall.Ucred{Pid: int32(os.Getpid()), Uid: uint32(os.Getuid()), Gid: uint32(os.Getgid())} 16 | b := syscall.UnixCredentials(ucred) 17 | _, oobn, err := t.UnixConn.WriteMsgUnix([]byte{0}, b, nil) 18 | if err != nil { 19 | return err 20 | } 21 | if oobn != len(b) { 22 | return io.ErrShortWrite 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /test/integration/dnet/dnet.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load helpers 4 | 5 | @test "Test dnet custom port" { 6 | start_dnet 1 a 4567 7 | dnet_cmd 4567 network ls 8 | stop_dnet 1 a 9 | } 10 | 11 | @test "Test dnet invalid custom port" { 12 | start_dnet 1 b 4567 13 | run dnet_cmd 4568 network ls 14 | echo ${output} 15 | [ "$status" -ne 0 ] 16 | stop_dnet 1 b 17 | } 18 | 19 | @test "Test dnet invalid params" { 20 | start_dnet 1 c 21 | run dnet_cmd 8080 network ls 22 | echo ${output} 23 | [ "$status" -ne 0 ] 24 | run ./cmd/dnet/dnet -H=unix://var/run/dnet.sock network ls 25 | echo ${output} 26 | [ "$status" -ne 0 ] 27 | run ./cmd/dnet/dnet -H= -l=invalid network ls 28 | echo ${output} 29 | [ "$status" -ne 0 ] 30 | stop_dnet 1 c 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if the given file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stdout 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stacktrace/capture.go: -------------------------------------------------------------------------------- 1 | package stacktrace 2 | 3 | import "runtime" 4 | 5 | // Caputure captures a stacktrace for the current calling go program 6 | // 7 | // skip is the number of frames to skip 8 | func Capture(userSkip int) Stacktrace { 9 | var ( 10 | skip = userSkip + 1 // add one for our own function 11 | frames []Frame 12 | prevPc uintptr = 0 13 | ) 14 | for i := skip; ; i++ { 15 | pc, file, line, ok := runtime.Caller(i) 16 | //detect if caller is repeated to avoid loop, gccgo 17 | //currently runs into a loop without this check 18 | if !ok || pc == prevPc { 19 | break 20 | } 21 | frames = append(frames, NewFrame(pc, file, line)) 22 | prevPc = pc 23 | } 24 | return Stacktrace{ 25 | Frames: frames, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ugorji/go/codec/helper_not_unsafe.go: -------------------------------------------------------------------------------- 1 | //+build !unsafe 2 | 3 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 4 | // Use of this source code is governed by a MIT license found in the LICENSE file. 5 | 6 | package codec 7 | 8 | // stringView returns a view of the []byte as a string. 9 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 10 | // In regular safe mode, it is an allocation and copy. 11 | func stringView(v []byte) string { 12 | return string(v) 13 | } 14 | 15 | // bytesView returns a view of the string as a []byte. 16 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 17 | // In regular safe mode, it is an allocation and copy. 18 | func bytesView(v string) []byte { 19 | return []byte(v) 20 | } 21 | -------------------------------------------------------------------------------- /drivers/bridge/setup_ip_forwarding.go: -------------------------------------------------------------------------------- 1 | package bridge 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | ) 7 | 8 | const ( 9 | ipv4ForwardConf = "/proc/sys/net/ipv4/ip_forward" 10 | ipv4ForwardConfPerm = 0644 11 | ) 12 | 13 | func setupIPForwarding() error { 14 | // Get current IPv4 forward setup 15 | ipv4ForwardData, err := ioutil.ReadFile(ipv4ForwardConf) 16 | if err != nil { 17 | return fmt.Errorf("Cannot read IP forwarding setup: %v", err) 18 | } 19 | 20 | // Enable IPv4 forwarding only if it is not already enabled 21 | if ipv4ForwardData[0] != '1' { 22 | // Enable IPv4 forwarding 23 | if err := ioutil.WriteFile(ipv4ForwardConf, []byte{'1', '\n'}, ipv4ForwardConfPerm); err != nil { 24 | return fmt.Errorf("Setup IP forwarding failed: %v", err) 25 | } 26 | } 27 | 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/rename.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | 6 | flag "github.com/docker/docker/pkg/mflag" 7 | ) 8 | 9 | // CmdRename renames a container. 10 | // 11 | // Usage: docker rename OLD_NAME NEW_NAME 12 | func (cli *DockerCli) CmdRename(args ...string) error { 13 | cmd := cli.Subcmd("rename", "OLD_NAME NEW_NAME", "Rename a container", true) 14 | cmd.Require(flag.Exact, 2) 15 | cmd.ParseFlags(args, true) 16 | 17 | oldName := cmd.Arg(0) 18 | newName := cmd.Arg(1) 19 | 20 | if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/rename?name=%s", oldName, newName), nil, nil)); err != nil { 21 | fmt.Fprintf(cli.err, "%s\n", err) 22 | return fmt.Errorf("Error: failed to rename container named %s", oldName) 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/reexec/command_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | "syscall" 8 | ) 9 | 10 | // Self returns the path to the current process's binary. 11 | // Returns "/proc/self/exe". 12 | func Self() string { 13 | return "/proc/self/exe" 14 | } 15 | 16 | // Command returns *exec.Cmd which have Path as current binary. Also it setting 17 | // SysProcAttr.Pdeathsig to SIGTERM. 18 | // This will use the in-memory version (/proc/self/exe) of the current binary, 19 | // it is thus safe to delete or replace the on-disk binary (os.Args[0]). 20 | func Command(args ...string) *exec.Cmd { 21 | return &exec.Cmd{ 22 | Path: Self(), 23 | Args: args, 24 | SysProcAttr: &syscall.SysProcAttr{ 25 | Pdeathsig: syscall.SIGTERM, 26 | }, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/consul/api/event_test.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestEvent_FireList(t *testing.T) { 8 | c, s := makeClient(t) 9 | defer s.stop() 10 | 11 | event := c.Event() 12 | 13 | params := &UserEvent{Name: "foo"} 14 | id, meta, err := event.Fire(params, nil) 15 | if err != nil { 16 | t.Fatalf("err: %v", err) 17 | } 18 | 19 | if meta.RequestTime == 0 { 20 | t.Fatalf("bad: %v", meta) 21 | } 22 | 23 | if id == "" { 24 | t.Fatalf("invalid: %v", id) 25 | } 26 | 27 | events, qm, err := event.List("", nil) 28 | if err != nil { 29 | t.Fatalf("err: %v", err) 30 | } 31 | 32 | if qm.LastIndex != event.IDToIndex(id) { 33 | t.Fatalf("Bad: %#v", qm) 34 | } 35 | 36 | if events[len(events)-1].ID != id { 37 | t.Fatalf("bad: %#v", events) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/context/withtimeout_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package context_test 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | func ExampleWithTimeout() { 15 | // Pass a context with a timeout to tell a blocking function that it 16 | // should abandon its work after the timeout elapses. 17 | ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond) 18 | select { 19 | case <-time.After(200 * time.Millisecond): 20 | fmt.Println("overslept") 21 | case <-ctx.Done(): 22 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 23 | } 24 | // Output: 25 | // context deadline exceeded 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/stat_test.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | "testing" 7 | ) 8 | 9 | // TestFromStatT tests fromStatT for a tempfile 10 | func TestFromStatT(t *testing.T) { 11 | file, _, _, dir := prepareFiles(t) 12 | defer os.RemoveAll(dir) 13 | 14 | stat := &syscall.Stat_t{} 15 | err := syscall.Lstat(file, stat) 16 | 17 | s, err := fromStatT(stat) 18 | if err != nil { 19 | t.Fatal(err) 20 | } 21 | 22 | if stat.Mode != s.Mode() { 23 | t.Fatal("got invalid mode") 24 | } 25 | if stat.Uid != s.UID() { 26 | t.Fatal("got invalid uid") 27 | } 28 | if stat.Gid != s.Gid() { 29 | t.Fatal("got invalid gid") 30 | } 31 | if stat.Rdev != s.Rdev() { 32 | t.Fatal("got invalid rdev") 33 | } 34 | if stat.Mtim != s.Mtim() { 35 | t.Fatal("got invalid mtim") 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /default_gateway_linux.go: -------------------------------------------------------------------------------- 1 | package libnetwork 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | 7 | "github.com/docker/libnetwork/drivers/bridge" 8 | "github.com/docker/libnetwork/netlabel" 9 | "github.com/docker/libnetwork/options" 10 | ) 11 | 12 | func (c *controller) createGWNetwork() (Network, error) { 13 | netOption := map[string]string{ 14 | bridge.BridgeName: libnGWNetwork, 15 | bridge.EnableICC: strconv.FormatBool(false), 16 | bridge.EnableIPMasquerade: strconv.FormatBool(true), 17 | } 18 | 19 | n, err := c.NewNetwork("bridge", libnGWNetwork, 20 | NetworkOptionGeneric(options.Generic{ 21 | netlabel.GenericData: netOption, 22 | netlabel.EnableIPv6: false, 23 | })) 24 | 25 | if err != nil { 26 | return nil, fmt.Errorf("error creating external connectivity network: %v", err) 27 | } 28 | return n, err 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/transport_generic.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "encoding/binary" 5 | "errors" 6 | "io" 7 | ) 8 | 9 | type genericTransport struct { 10 | io.ReadWriteCloser 11 | } 12 | 13 | func (t genericTransport) SendNullByte() error { 14 | _, err := t.Write([]byte{0}) 15 | return err 16 | } 17 | 18 | func (t genericTransport) SupportsUnixFDs() bool { 19 | return false 20 | } 21 | 22 | func (t genericTransport) EnableUnixFDs() {} 23 | 24 | func (t genericTransport) ReadMessage() (*Message, error) { 25 | return DecodeMessage(t) 26 | } 27 | 28 | func (t genericTransport) SendMessage(msg *Message) error { 29 | for _, v := range msg.Body { 30 | if _, ok := v.(UnixFD); ok { 31 | return errors.New("dbus: unix fd passing not enabled") 32 | } 33 | } 34 | return msg.EncodeTo(t, binary.LittleEndian) 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/swarm/discovery/generator.go: -------------------------------------------------------------------------------- 1 | package discovery 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "strconv" 7 | ) 8 | 9 | // Generate takes care of IP generation 10 | func Generate(pattern string) []string { 11 | re, _ := regexp.Compile(`\[(.+):(.+)\]`) 12 | submatch := re.FindStringSubmatch(pattern) 13 | if submatch == nil { 14 | return []string{pattern} 15 | } 16 | 17 | from, err := strconv.Atoi(submatch[1]) 18 | if err != nil { 19 | return []string{pattern} 20 | } 21 | to, err := strconv.Atoi(submatch[2]) 22 | if err != nil { 23 | return []string{pattern} 24 | } 25 | 26 | template := re.ReplaceAllString(pattern, "%d") 27 | 28 | var result []string 29 | for val := from; val <= to; val++ { 30 | entry := fmt.Sprintf(template, val) 31 | result = append(result, entry) 32 | } 33 | 34 | return result 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netlink/Makefile: -------------------------------------------------------------------------------- 1 | DIRS := \ 2 | . \ 3 | nl 4 | 5 | DEPS = \ 6 | github.com/vishvananda/netns 7 | 8 | uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) 9 | testdirs = $(call uniq,$(foreach d,$(1),$(dir $(wildcard $(d)/*_test.go)))) 10 | goroot = $(addprefix ../../../,$(1)) 11 | unroot = $(subst ../../../,,$(1)) 12 | fmt = $(addprefix fmt-,$(1)) 13 | 14 | all: fmt 15 | 16 | $(call goroot,$(DEPS)): 17 | go get $(call unroot,$@) 18 | 19 | .PHONY: $(call testdirs,$(DIRS)) 20 | $(call testdirs,$(DIRS)): 21 | sudo -E go test -v github.com/vishvananda/netlink/$@ 22 | 23 | $(call fmt,$(call testdirs,$(DIRS))): 24 | ! gofmt -l $(subst fmt-,,$@)/*.go | grep '' 25 | 26 | .PHONY: fmt 27 | fmt: $(call fmt,$(call testdirs,$(DIRS))) 28 | 29 | test: fmt $(call goroot,$(DEPS)) $(call testdirs,$(DIRS)) 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/stats_unit_test.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "bytes" 5 | "sync" 6 | "testing" 7 | ) 8 | 9 | func TestDisplay(t *testing.T) { 10 | c := &containerStats{ 11 | Name: "app", 12 | CPUPercentage: 30.0, 13 | Memory: 100 * 1024 * 1024.0, 14 | MemoryLimit: 2048 * 1024 * 1024.0, 15 | MemoryPercentage: 100.0 / 2048.0 * 100.0, 16 | NetworkRx: 100 * 1024 * 1024, 17 | NetworkTx: 800 * 1024 * 1024, 18 | mu: sync.RWMutex{}, 19 | } 20 | var b bytes.Buffer 21 | if err := c.Display(&b); err != nil { 22 | t.Fatalf("c.Display() gave error: %s", err) 23 | } 24 | got := b.String() 25 | want := "app\t30.00%\t104.9 MB/2.147 GB\t4.88%\t104.9 MB/838.9 MB\n" 26 | if got != want { 27 | t.Fatalf("c.Display() = %q, want %q", got, want) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/discovery/generator.go: -------------------------------------------------------------------------------- 1 | package discovery 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "strconv" 7 | ) 8 | 9 | // Generate takes care of IP generation 10 | func Generate(pattern string) []string { 11 | re, _ := regexp.Compile(`\[(.+):(.+)\]`) 12 | submatch := re.FindStringSubmatch(pattern) 13 | if submatch == nil { 14 | return []string{pattern} 15 | } 16 | 17 | from, err := strconv.Atoi(submatch[1]) 18 | if err != nil { 19 | return []string{pattern} 20 | } 21 | to, err := strconv.Atoi(submatch[2]) 22 | if err != nil { 23 | return []string{pattern} 24 | } 25 | 26 | template := re.ReplaceAllString(pattern, "%d") 27 | 28 | var result []string 29 | for val := from; val <= to; val++ { 30 | entry := fmt.Sprintf(template, val) 31 | result = append(result, entry) 32 | } 33 | 34 | return result 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/homedir_static.go: -------------------------------------------------------------------------------- 1 | // +build static_build 2 | 3 | package dbus 4 | 5 | import ( 6 | "bufio" 7 | "os" 8 | "strconv" 9 | "strings" 10 | ) 11 | 12 | func lookupHomeDir() string { 13 | myUid := os.Getuid() 14 | 15 | f, err := os.Open("/etc/passwd") 16 | if err != nil { 17 | return "/" 18 | } 19 | defer f.Close() 20 | 21 | s := bufio.NewScanner(f) 22 | 23 | for s.Scan() { 24 | if err := s.Err(); err != nil { 25 | break 26 | } 27 | 28 | line := strings.TrimSpace(s.Text()) 29 | if line == "" { 30 | continue 31 | } 32 | 33 | parts := strings.Split(line, ":") 34 | 35 | if len(parts) >= 6 { 36 | uid, err := strconv.Atoi(parts[2]) 37 | if err == nil && uid == myUid { 38 | return parts[5] 39 | } 40 | } 41 | } 42 | 43 | // Default to / if we can't get a better value 44 | return "/" 45 | } 46 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/codegangsta/cli/help_test.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | ) 7 | 8 | func Test_ShowAppHelp_NoAuthor(t *testing.T) { 9 | output := new(bytes.Buffer) 10 | app := NewApp() 11 | app.Writer = output 12 | 13 | c := NewContext(app, nil, nil) 14 | 15 | ShowAppHelp(c) 16 | 17 | if bytes.Index(output.Bytes(), []byte("AUTHOR(S):")) != -1 { 18 | t.Errorf("expected\n%snot to include %s", output.String(), "AUTHOR(S):") 19 | } 20 | } 21 | 22 | func Test_ShowAppHelp_NoVersion(t *testing.T) { 23 | output := new(bytes.Buffer) 24 | app := NewApp() 25 | app.Writer = output 26 | 27 | app.Version = "" 28 | 29 | c := NewContext(app, nil, nil) 30 | 31 | ShowAppHelp(c) 32 | 33 | if bytes.Index(output.Bytes(), []byte("VERSION:")) != -1 { 34 | t.Errorf("expected\n%snot to include %s", output.String(), "VERSION:") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/proxy/stub_proxy.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import ( 4 | "net" 5 | ) 6 | 7 | // StubProxy is a proxy that is a stub (does nothing). 8 | type StubProxy struct { 9 | frontendAddr net.Addr 10 | backendAddr net.Addr 11 | } 12 | 13 | // Run does nothing. 14 | func (p *StubProxy) Run() {} 15 | 16 | // Close does nothing. 17 | func (p *StubProxy) Close() {} 18 | 19 | // FrontendAddr returns the frontend address. 20 | func (p *StubProxy) FrontendAddr() net.Addr { return p.frontendAddr } 21 | 22 | // BackendAddr returns the backend address. 23 | func (p *StubProxy) BackendAddr() net.Addr { return p.backendAddr } 24 | 25 | // NewStubProxy creates a new StubProxy 26 | func NewStubProxy(frontendAddr, backendAddr net.Addr) (Proxy, error) { 27 | return &StubProxy{ 28 | frontendAddr: frontendAddr, 29 | backendAddr: backendAddr, 30 | }, nil 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package fs 4 | 5 | import ( 6 | "github.com/opencontainers/runc/libcontainer/cgroups" 7 | "github.com/opencontainers/runc/libcontainer/configs" 8 | ) 9 | 10 | type PerfEventGroup struct { 11 | } 12 | 13 | func (s *PerfEventGroup) Apply(d *data) error { 14 | // we just want to join this group even though we don't set anything 15 | if _, err := d.join("perf_event"); err != nil && !cgroups.IsNotFound(err) { 16 | return err 17 | } 18 | return nil 19 | } 20 | 21 | func (s *PerfEventGroup) Set(path string, cgroup *configs.Cgroup) error { 22 | return nil 23 | } 24 | 25 | func (s *PerfEventGroup) Remove(d *data) error { 26 | return removePath(d.path("perf_event")) 27 | } 28 | 29 | func (s *PerfEventGroup) GetStats(path string, stats *cgroups.Stats) error { 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/netlink/netlink.go: -------------------------------------------------------------------------------- 1 | // Packet netlink provide access to low level Netlink sockets and messages. 2 | // 3 | // Actual implementations are in: 4 | // netlink_linux.go 5 | // netlink_darwin.go 6 | package netlink 7 | 8 | import ( 9 | "errors" 10 | "net" 11 | ) 12 | 13 | var ( 14 | ErrWrongSockType = errors.New("Wrong socket type") 15 | ErrShortResponse = errors.New("Got short response from netlink") 16 | ErrInterfaceExists = errors.New("Network interface already exists") 17 | ) 18 | 19 | // A Route is a subnet associated with the interface to reach it. 20 | type Route struct { 21 | *net.IPNet 22 | Iface *net.Interface 23 | Default bool 24 | } 25 | 26 | // An IfAddr defines IP network settings for a given network interface 27 | type IfAddr struct { 28 | Iface *net.Interface 29 | IP net.IP 30 | IPNet *net.IPNet 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/script/validate-gofmt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname "$BASH_SOURCE")/.validate" 4 | 5 | IFS=$'\n' 6 | files=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^Godeps/' || true) ) 7 | unset IFS 8 | 9 | badFiles=() 10 | for f in "${files[@]}"; do 11 | # we use "git show" here to validate that what's committed is formatted 12 | if [ "$(git show "$VALIDATE_HEAD:$f" | gofmt -s -l)" ]; then 13 | badFiles+=( "$f" ) 14 | fi 15 | done 16 | 17 | if [ ${#badFiles[@]} -eq 0 ]; then 18 | echo 'Congratulations! All Go source files are properly formatted.' 19 | else 20 | { 21 | echo "These files are not properly gofmt'd:" 22 | for f in "${badFiles[@]}"; do 23 | echo " - $f" 24 | done 25 | echo 26 | echo 'Please reformat the above files using "gofmt -s -w" and commit the result.' 27 | echo 28 | } >&2 29 | false 30 | fi 31 | -------------------------------------------------------------------------------- /drivers/bridge/link_test.go: -------------------------------------------------------------------------------- 1 | package bridge 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/docker/libnetwork/types" 7 | ) 8 | 9 | func getPorts() []types.TransportPort { 10 | return []types.TransportPort{ 11 | types.TransportPort{Proto: types.TCP, Port: uint16(5000)}, 12 | types.TransportPort{Proto: types.UDP, Port: uint16(400)}, 13 | types.TransportPort{Proto: types.TCP, Port: uint16(600)}, 14 | } 15 | } 16 | 17 | func TestLinkNew(t *testing.T) { 18 | ports := getPorts() 19 | 20 | link := newLink("172.0.17.3", "172.0.17.2", ports, "docker0") 21 | 22 | if link == nil { 23 | t.FailNow() 24 | } 25 | if link.parentIP != "172.0.17.3" { 26 | t.Fail() 27 | } 28 | if link.childIP != "172.0.17.2" { 29 | t.Fail() 30 | } 31 | for i, p := range link.ports { 32 | if p != ports[i] { 33 | t.Fail() 34 | } 35 | } 36 | if link.bridge != "docker0" { 37 | t.Fail() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/help.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | 6 | flag "github.com/docker/docker/pkg/mflag" 7 | ) 8 | 9 | // CmdHelp displays information on a Docker command. 10 | // 11 | // If more than one command is specified, information is only shown for the first command. 12 | // 13 | // Usage: docker help COMMAND or docker COMMAND --help 14 | func (cli *DockerCli) CmdHelp(args ...string) error { 15 | if len(args) > 1 { 16 | method, exists := cli.getMethod(args[:2]...) 17 | if exists { 18 | method("--help") 19 | return nil 20 | } 21 | } 22 | if len(args) > 0 { 23 | method, exists := cli.getMethod(args[0]) 24 | if !exists { 25 | return fmt.Errorf("docker: '%s' is not a docker command. See 'docker --help'.", args[0]) 26 | } 27 | method("--help") 28 | return nil 29 | } 30 | 31 | flag.Usage() 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package configs 4 | 5 | import "syscall" 6 | 7 | func (n *Namespace) Syscall() int { 8 | return namespaceInfo[n.Type] 9 | } 10 | 11 | var namespaceInfo = map[NamespaceType]int{ 12 | NEWNET: syscall.CLONE_NEWNET, 13 | NEWNS: syscall.CLONE_NEWNS, 14 | NEWUSER: syscall.CLONE_NEWUSER, 15 | NEWIPC: syscall.CLONE_NEWIPC, 16 | NEWUTS: syscall.CLONE_NEWUTS, 17 | NEWPID: syscall.CLONE_NEWPID, 18 | } 19 | 20 | // CloneFlags parses the container's Namespaces options to set the correct 21 | // flags on clone, unshare. This functions returns flags only for new namespaces. 22 | func (n *Namespaces) CloneFlags() uintptr { 23 | var flag int 24 | for _, v := range *n { 25 | if v.Path != "" { 26 | continue 27 | } 28 | flag |= namespaceInfo[v.Type] 29 | } 30 | return uintptr(flag) 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/text_formatter_test.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestQuoting(t *testing.T) { 11 | tf := &TextFormatter{DisableColors: true} 12 | 13 | checkQuoting := func(q bool, value interface{}) { 14 | b, _ := tf.Format(WithField("test", value)) 15 | idx := bytes.Index(b, ([]byte)("test=")) 16 | cont := bytes.Contains(b[idx+5:], []byte{'"'}) 17 | if cont != q { 18 | if q { 19 | t.Errorf("quoting expected for: %#v", value) 20 | } else { 21 | t.Errorf("quoting not expected for: %#v", value) 22 | } 23 | } 24 | } 25 | 26 | checkQuoting(false, "abcd") 27 | checkQuoting(false, "v1.0") 28 | checkQuoting(true, "/foobar") 29 | checkQuoting(true, "x y") 30 | checkQuoting(true, "x,y") 31 | checkQuoting(false, errors.New("invalid")) 32 | checkQuoting(true, errors.New("invalid argument")) 33 | } 34 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/serf/serf/merge_delegate.go: -------------------------------------------------------------------------------- 1 | package serf 2 | 3 | import ( 4 | "net" 5 | 6 | "github.com/hashicorp/memberlist" 7 | ) 8 | 9 | type MergeDelegate interface { 10 | NotifyMerge([]*Member) (cancel bool) 11 | } 12 | 13 | type mergeDelegate struct { 14 | serf *Serf 15 | } 16 | 17 | func (m *mergeDelegate) NotifyMerge(nodes []*memberlist.Node) (cancel bool) { 18 | members := make([]*Member, len(nodes)) 19 | for idx, n := range nodes { 20 | members[idx] = &Member{ 21 | Name: n.Name, 22 | Addr: net.IP(n.Addr), 23 | Port: n.Port, 24 | Tags: m.serf.decodeTags(n.Meta), 25 | Status: StatusNone, 26 | ProtocolMin: n.PMin, 27 | ProtocolMax: n.PMax, 28 | ProtocolCur: n.PCur, 29 | DelegateMin: n.DMin, 30 | DelegateMax: n.DMax, 31 | DelegateCur: n.DCur, 32 | } 33 | } 34 | return m.serf.config.Merge.NotifyMerge(members) 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/mknod.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Mknod creates a filesystem node (file, device special file or named pipe) named path 10 | // with attributes specified by mode and dev. 11 | func Mknod(path string, mode uint32, dev int) error { 12 | return syscall.Mknod(path, mode, dev) 13 | } 14 | 15 | // Mkdev is used to build the value of linux devices (in /dev/) which specifies major 16 | // and minor number of the newly created device special file. 17 | // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. 18 | // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, 19 | // then the top 12 bits of the minor. 20 | func Mkdev(major int64, minor int64) uint32 { 21 | return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/coreos/etcd/client/discover.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package client 16 | 17 | // Discoverer is an interface that wraps the Discover method. 18 | type Discoverer interface { 19 | // Dicover looks up the etcd servers for the domain. 20 | Discover(domain string) ([]string, error) 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/stat_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: s.Mode, 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: s.Rdev, 14 | mtim: s.Mtim}, nil 15 | } 16 | 17 | // FromStatT exists only on linux, and loads a system.StatT from a 18 | // syscal.Stat_t. 19 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 20 | return fromStatT(s) 21 | } 22 | 23 | // Stat takes a path to a file and returns 24 | // a system.StatT type pertaining to that file. 25 | // 26 | // Throws an error if the file does not exist 27 | func Stat(path string) (*StatT, error) { 28 | s := &syscall.Stat_t{} 29 | if err := syscall.Stat(path, s); err != nil { 30 | return nil, err 31 | } 32 | return fromStatT(s) 33 | } 34 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stacktrace/capture_test.go: -------------------------------------------------------------------------------- 1 | package stacktrace 2 | 3 | import "testing" 4 | 5 | func captureFunc() Stacktrace { 6 | return Capture(0) 7 | } 8 | 9 | func TestCaptureTestFunc(t *testing.T) { 10 | stack := captureFunc() 11 | 12 | if len(stack.Frames) == 0 { 13 | t.Fatal("expected stack frames to be returned") 14 | } 15 | 16 | // the first frame is the caller 17 | frame := stack.Frames[0] 18 | if expected := "captureFunc"; frame.Function != expected { 19 | t.Fatalf("expteced function %q but recevied %q", expected, frame.Function) 20 | } 21 | if expected := "github.com/opencontainers/runc/libcontainer/stacktrace"; frame.Package != expected { 22 | t.Fatalf("expected package %q but received %q", expected, frame.Package) 23 | } 24 | if expected := "capture_test.go"; frame.File != expected { 25 | t.Fatalf("expected file %q but received %q", expected, frame.File) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package utils 4 | 5 | import ( 6 | "io/ioutil" 7 | "strconv" 8 | "syscall" 9 | ) 10 | 11 | func CloseExecFrom(minFd int) error { 12 | fdList, err := ioutil.ReadDir("/proc/self/fd") 13 | if err != nil { 14 | return err 15 | } 16 | for _, fi := range fdList { 17 | fd, err := strconv.Atoi(fi.Name()) 18 | if err != nil { 19 | // ignore non-numeric file names 20 | continue 21 | } 22 | 23 | if fd < minFd { 24 | // ignore descriptors lower than our specified minimum 25 | continue 26 | } 27 | 28 | // intentionally ignore errors from syscall.CloseOnExec 29 | syscall.CloseOnExec(fd) 30 | // the cases where this might fail are basically file descriptors that have already been closed (including and especially the one that was created when ioutil.ReadDir did the "opendir" syscall) 31 | } 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /netlabel/labels_test.go: -------------------------------------------------------------------------------- 1 | package netlabel 2 | 3 | import ( 4 | "testing" 5 | 6 | _ "github.com/docker/libnetwork/testutils" 7 | ) 8 | 9 | var input = []struct { 10 | label string 11 | key string 12 | value string 13 | }{ 14 | {"com.directory.person.name=joe", "com.directory.person.name", "joe"}, 15 | {"com.directory.person.age=24", "com.directory.person.age", "24"}, 16 | {"com.directory.person.address=1234 First st.", "com.directory.person.address", "1234 First st."}, 17 | {"com.directory.person.friends=", "com.directory.person.friends", ""}, 18 | {"com.directory.person.nickname=o=u=8", "com.directory.person.nickname", "o=u=8"}, 19 | {"", "", ""}, 20 | {"com.directory.person.student", "com.directory.person.student", ""}, 21 | } 22 | 23 | func TestKeyValue(t *testing.T) { 24 | for _, i := range input { 25 | k, v := KeyValue(i.label) 26 | if k != i.key || v != i.value { 27 | t.Fatalf("unexpected: %s, %s", k, v) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ipams/builtin/builtin.go: -------------------------------------------------------------------------------- 1 | package builtin 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/libnetwork/datastore" 7 | "github.com/docker/libnetwork/ipam" 8 | "github.com/docker/libnetwork/ipamapi" 9 | ) 10 | 11 | // Init registers the built-in ipam service with libnetwork 12 | func Init(ic ipamapi.Callback, l, g interface{}) error { 13 | var ( 14 | ok bool 15 | localDs, globalDs datastore.DataStore 16 | ) 17 | 18 | if l != nil { 19 | if localDs, ok = l.(datastore.DataStore); !ok { 20 | return fmt.Errorf("incorrect local datastore passed to built-in ipam init") 21 | } 22 | } 23 | 24 | if g != nil { 25 | if globalDs, ok = g.(datastore.DataStore); !ok { 26 | return fmt.Errorf("incorrect global datastore passed to built-in ipam init") 27 | } 28 | } 29 | a, err := ipam.NewAllocator(localDs, globalDs) 30 | if err != nil { 31 | return err 32 | } 33 | 34 | return ic.RegisterIpamDriver(ipamapi.DefaultIPAM, a) 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/system/proc.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "io/ioutil" 5 | "path/filepath" 6 | "strconv" 7 | "strings" 8 | ) 9 | 10 | // look in /proc to find the process start time so that we can verify 11 | // that this pid has started after ourself 12 | func GetProcessStartTime(pid int) (string, error) { 13 | data, err := ioutil.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "stat")) 14 | if err != nil { 15 | return "", err 16 | } 17 | 18 | parts := strings.Split(string(data), " ") 19 | // the starttime is located at pos 22 20 | // from the man page 21 | // 22 | // starttime %llu (was %lu before Linux 2.6) 23 | // (22) The time the process started after system boot. In kernels before Linux 2.6, this 24 | // value was expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks 25 | // (divide by sysconf(_SC_CLK_TCK)). 26 | return parts[22-1], nil // starts at 1 27 | } 28 | -------------------------------------------------------------------------------- /ipamutils/utils_windows.go: -------------------------------------------------------------------------------- 1 | // Package ipamutils provides utililty functions for ipam management 2 | package ipamutils 3 | 4 | import ( 5 | "net" 6 | 7 | "github.com/docker/libnetwork/types" 8 | ) 9 | 10 | // ElectInterfaceAddresses looks for an interface on the OS with the specified name 11 | // and returns its IPv4 and IPv6 addresses in CIDR form. If the interface does not exist, 12 | // it chooses from a predifined list the first IPv4 address which does not conflict 13 | // with other interfaces on the system. 14 | func ElectInterfaceAddresses(name string) (*net.IPNet, []*net.IPNet, error) { 15 | return nil, nil, types.NotImplementedErrorf("not supported on windows") 16 | } 17 | 18 | // FindAvailableNetwork returns a network from the passed list which does not 19 | // overlap with existing interfaces in the system 20 | func FindAvailableNetwork(list []*net.IPNet) (*net.IPNet, error) { 21 | return nil, types.NotImplementedErrorf("not supported on windows") 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/plugins/pluginrpc-gen/fixtures/foo.go: -------------------------------------------------------------------------------- 1 | package foo 2 | 3 | type wobble struct { 4 | Some string 5 | Val string 6 | Inception *wobble 7 | } 8 | 9 | // Fooer is an empty interface used for tests. 10 | type Fooer interface{} 11 | 12 | // Fooer2 is an interface used for tests. 13 | type Fooer2 interface { 14 | Foo() 15 | } 16 | 17 | // Fooer3 is an interface used for tests. 18 | type Fooer3 interface { 19 | Foo() 20 | Bar(a string) 21 | Baz(a string) (err error) 22 | Qux(a, b string) (val string, err error) 23 | Wobble() (w *wobble) 24 | Wiggle() (w wobble) 25 | } 26 | 27 | // Fooer4 is an interface used for tests. 28 | type Fooer4 interface { 29 | Foo() error 30 | } 31 | 32 | // Bar is an interface used for tests. 33 | type Bar interface { 34 | Boo(a string, b string) (s string, err error) 35 | } 36 | 37 | // Fooer5 is an interface used for tests. 38 | type Fooer5 interface { 39 | Foo() 40 | Bar 41 | } 42 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/stacktrace/frame.go: -------------------------------------------------------------------------------- 1 | package stacktrace 2 | 3 | import ( 4 | "path/filepath" 5 | "runtime" 6 | "strings" 7 | ) 8 | 9 | // NewFrame returns a new stack frame for the provided information 10 | func NewFrame(pc uintptr, file string, line int) Frame { 11 | fn := runtime.FuncForPC(pc) 12 | if fn == nil { 13 | return Frame{} 14 | } 15 | pack, name := parseFunctionName(fn.Name()) 16 | return Frame{ 17 | Line: line, 18 | File: filepath.Base(file), 19 | Package: pack, 20 | Function: name, 21 | } 22 | } 23 | 24 | func parseFunctionName(name string) (string, string) { 25 | i := strings.LastIndex(name, ".") 26 | if i == -1 { 27 | return "", name 28 | } 29 | return name[:i], name[i+1:] 30 | } 31 | 32 | // Frame contains all the information for a stack frame within a go program 33 | type Frame struct { 34 | File string 35 | Function string 36 | Package string 37 | Line int 38 | } 39 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netlink/nl/route_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | type RtMsg struct { 9 | syscall.RtMsg 10 | } 11 | 12 | func NewRtMsg() *RtMsg { 13 | return &RtMsg{ 14 | RtMsg: syscall.RtMsg{ 15 | Table: syscall.RT_TABLE_MAIN, 16 | Scope: syscall.RT_SCOPE_UNIVERSE, 17 | Protocol: syscall.RTPROT_BOOT, 18 | Type: syscall.RTN_UNICAST, 19 | }, 20 | } 21 | } 22 | 23 | func NewRtDelMsg() *RtMsg { 24 | return &RtMsg{ 25 | RtMsg: syscall.RtMsg{ 26 | Table: syscall.RT_TABLE_MAIN, 27 | Scope: syscall.RT_SCOPE_NOWHERE, 28 | }, 29 | } 30 | } 31 | 32 | func (msg *RtMsg) Len() int { 33 | return syscall.SizeofRtMsg 34 | } 35 | 36 | func DeserializeRtMsg(b []byte) *RtMsg { 37 | return (*RtMsg)(unsafe.Pointer(&b[0:syscall.SizeofRtMsg][0])) 38 | } 39 | 40 | func (msg *RtMsg) Serialize() []byte { 41 | return (*(*[syscall.SizeofRtMsg]byte)(unsafe.Pointer(msg)))[:] 42 | } 43 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/examples/basic/basic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.New() 8 | 9 | func init() { 10 | log.Formatter = new(logrus.JSONFormatter) 11 | log.Formatter = new(logrus.TextFormatter) // default 12 | } 13 | 14 | func main() { 15 | defer func() { 16 | err := recover() 17 | if err != nil { 18 | log.WithFields(logrus.Fields{ 19 | "omg": true, 20 | "err": err, 21 | "number": 100, 22 | }).Fatal("The ice breaks!") 23 | } 24 | }() 25 | 26 | log.WithFields(logrus.Fields{ 27 | "animal": "walrus", 28 | "size": 10, 29 | }).Info("A group of walrus emerges from the ocean") 30 | 31 | log.WithFields(logrus.Fields{ 32 | "omg": true, 33 | "number": 122, 34 | }).Warn("The group's number increased tremendously!") 35 | 36 | log.WithFields(logrus.Fields{ 37 | "animal": "orca", 38 | "size": 9009, 39 | }).Panic("It's over 9000!") 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ugorji/go/codec/py_test.go: -------------------------------------------------------------------------------- 1 | //+build x 2 | 3 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 4 | // Use of this source code is governed by a MIT license found in the LICENSE file. 5 | 6 | package codec 7 | 8 | // These tests are used to verify msgpack and cbor implementations against their python libraries. 9 | // If you have the library installed, you can enable the tests back by removing the //+build ignore. 10 | 11 | import ( 12 | "testing" 13 | ) 14 | 15 | func TestMsgpackPythonGenStreams(t *testing.T) { 16 | doTestPythonGenStreams(t, "msgpack", testMsgpackH) 17 | } 18 | 19 | func TestCborPythonGenStreams(t *testing.T) { 20 | doTestPythonGenStreams(t, "cbor", testCborH) 21 | } 22 | 23 | func TestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) { 24 | doTestMsgpackRpcSpecGoClientToPythonSvc(t) 25 | } 26 | 27 | func TestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) { 28 | doTestMsgpackRpcSpecPythonClientToGoSvc(t) 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/container_userns_linux.go: -------------------------------------------------------------------------------- 1 | // +build go1.4 2 | 3 | package libcontainer 4 | 5 | import "syscall" 6 | 7 | // Converts IDMap to SysProcIDMap array and adds it to SysProcAttr. 8 | func (c *linuxContainer) addUidGidMappings(sys *syscall.SysProcAttr) error { 9 | if c.config.UidMappings != nil { 10 | sys.UidMappings = make([]syscall.SysProcIDMap, len(c.config.UidMappings)) 11 | for i, um := range c.config.UidMappings { 12 | sys.UidMappings[i].ContainerID = um.ContainerID 13 | sys.UidMappings[i].HostID = um.HostID 14 | sys.UidMappings[i].Size = um.Size 15 | } 16 | } 17 | if c.config.GidMappings != nil { 18 | sys.GidMappings = make([]syscall.SysProcIDMap, len(c.config.GidMappings)) 19 | for i, gm := range c.config.GidMappings { 20 | sys.GidMappings[i].ContainerID = gm.ContainerID 21 | sys.GidMappings[i].HostID = gm.HostID 22 | sys.GidMappings[i].Size = gm.Size 23 | } 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/utimes_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the specified path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | var _path *byte 12 | _path, err := syscall.BytePtrFromString(path) 13 | if err != nil { 14 | return err 15 | } 16 | 17 | if _, _, err := syscall.Syscall(syscall.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != syscall.ENOSYS { 18 | return err 19 | } 20 | 21 | return nil 22 | } 23 | 24 | // UtimesNano is used to change access and modification time of the specified path. 25 | // It can't be used for symbol link file. 26 | func UtimesNano(path string, ts []syscall.Timespec) error { 27 | return syscall.UtimesNano(path, ts) 28 | } 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio_test.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | 7 | "github.com/opencontainers/runc/libcontainer/configs" 8 | ) 9 | 10 | var ( 11 | prioMap = []*configs.IfPrioMap{ 12 | { 13 | Interface: "test", 14 | Priority: 5, 15 | }, 16 | } 17 | ) 18 | 19 | func TestNetPrioSetIfPrio(t *testing.T) { 20 | helper := NewCgroupTestUtil("net_prio", t) 21 | defer helper.cleanup() 22 | 23 | helper.CgroupData.c.NetPrioIfpriomap = prioMap 24 | netPrio := &NetPrioGroup{} 25 | if err := netPrio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil { 26 | t.Fatal(err) 27 | } 28 | 29 | value, err := getCgroupParamString(helper.CgroupPath, "net_prio.ifpriomap") 30 | if err != nil { 31 | t.Fatalf("Failed to parse net_prio.ifpriomap - %s", err) 32 | } 33 | if !strings.Contains(value, "test 5") { 34 | t.Fatal("Got the wrong value, set net_prio.ifpriomap failed.") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/seccomp/bpf.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package seccomp 4 | 5 | import "strings" 6 | 7 | type bpfLabel struct { 8 | label string 9 | location uint32 10 | } 11 | 12 | type bpfLabels []bpfLabel 13 | 14 | // labelIndex returns the index for the label if it exists in the slice. 15 | // if it does not exist in the slice it appends the label lb to the end 16 | // of the slice and returns the index. 17 | func labelIndex(labels *bpfLabels, lb string) uint32 { 18 | var id uint32 19 | for id = 0; id < uint32(len(*labels)); id++ { 20 | if strings.EqualFold(lb, (*labels)[id].label) { 21 | return id 22 | } 23 | } 24 | *labels = append(*labels, bpfLabel{lb, 0xffffffff}) 25 | return id 26 | } 27 | 28 | func scmpBpfStmt(code uint16, k uint32) sockFilter { 29 | return sockFilter{code, 0, 0, k} 30 | } 31 | 32 | func scmpBpfJump(code uint16, k uint32, jt, jf uint8) sockFilter { 33 | return sockFilter{code, jt, jf, k} 34 | } 35 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/examples/hook/hook.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "github.com/Sirupsen/logrus/hooks/airbrake" 6 | "github.com/tobi/airbrake-go" 7 | ) 8 | 9 | var log = logrus.New() 10 | 11 | func init() { 12 | log.Formatter = new(logrus.TextFormatter) // default 13 | log.Hooks.Add(new(logrus_airbrake.AirbrakeHook)) 14 | } 15 | 16 | func main() { 17 | airbrake.Endpoint = "https://exceptions.whatever.com/notifier_api/v2/notices.xml" 18 | airbrake.ApiKey = "whatever" 19 | airbrake.Environment = "production" 20 | 21 | log.WithFields(logrus.Fields{ 22 | "animal": "walrus", 23 | "size": 10, 24 | }).Info("A group of walrus emerges from the ocean") 25 | 26 | log.WithFields(logrus.Fields{ 27 | "omg": true, 28 | "number": 122, 29 | }).Warn("The group's number increased tremendously!") 30 | 31 | log.WithFields(logrus.Fields{ 32 | "omg": true, 33 | "number": 100, 34 | }).Fatal("The ice breaks!") 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/stat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | "time" 8 | ) 9 | 10 | // StatT type contains status of a file. It contains metadata 11 | // like name, permission, size, etc about a file. 12 | type StatT struct { 13 | name string 14 | size int64 15 | mode os.FileMode 16 | modTime time.Time 17 | isDir bool 18 | } 19 | 20 | // Name returns file's name. 21 | func (s StatT) Name() string { 22 | return s.name 23 | } 24 | 25 | // Size returns file's size. 26 | func (s StatT) Size() int64 { 27 | return s.size 28 | } 29 | 30 | // Mode returns file's permission mode. 31 | func (s StatT) Mode() os.FileMode { 32 | return s.mode 33 | } 34 | 35 | // ModTime returns file's last modification time. 36 | func (s StatT) ModTime() time.Time { 37 | return s.modTime 38 | } 39 | 40 | // IsDir returns whether file is actually a directory. 41 | func (s StatT) IsDir() bool { 42 | return s.isDir 43 | } 44 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/coreos/etcd/pkg/pathutil/path.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pathutil 6 | 7 | import "path" 8 | 9 | // CanonicalURLPath returns the canonical url path for p, which follows the rules: 10 | // 1. the path always starts with "/" 11 | // 2. replace multiple slashes with a single slash 12 | // 3. replace each '.' '..' path name element with equivalent one 13 | // 4. keep the trailing slash 14 | // The function is borrowed from stdlib http.cleanPath in server.go. 15 | func CanonicalURLPath(p string) string { 16 | if p == "" { 17 | return "/" 18 | } 19 | if p[0] != '/' { 20 | p = "/" + p 21 | } 22 | np := path.Clean(p) 23 | // path.Clean removes trailing slash except for root, 24 | // put the trailing slash back if necessary. 25 | if p[len(p)-1] == '/' && np != "/" { 26 | np += "/" 27 | } 28 | return np 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/pause.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | 6 | flag "github.com/docker/docker/pkg/mflag" 7 | ) 8 | 9 | // CmdPause pauses all processes within one or more containers. 10 | // 11 | // Usage: docker pause CONTAINER [CONTAINER...] 12 | func (cli *DockerCli) CmdPause(args ...string) error { 13 | cmd := cli.Subcmd("pause", "CONTAINER [CONTAINER...]", "Pause all processes within a container", true) 14 | cmd.Require(flag.Min, 1) 15 | cmd.ParseFlags(args, true) 16 | 17 | var errNames []string 18 | for _, name := range cmd.Args() { 19 | if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/pause", name), nil, nil)); err != nil { 20 | fmt.Fprintf(cli.err, "%s\n", err) 21 | errNames = append(errNames, name) 22 | } else { 23 | fmt.Fprintf(cli.out, "%s\n", name) 24 | } 25 | } 26 | if len(errNames) > 0 { 27 | return fmt.Errorf("Error: failed to pause containers: %v", errNames) 28 | } 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/consul/api/README.md: -------------------------------------------------------------------------------- 1 | Consul API client 2 | ================= 3 | 4 | This package provides the `api` package which attempts to 5 | provide programmatic access to the full Consul API. 6 | 7 | Currently, all of the Consul APIs included in version 0.3 are supported. 8 | 9 | Documentation 10 | ============= 11 | 12 | The full documentation is available on [Godoc](http://godoc.org/github.com/hashicorp/consul/api) 13 | 14 | Usage 15 | ===== 16 | 17 | Below is an example of using the Consul client: 18 | 19 | ```go 20 | // Get a new client, with KV endpoints 21 | client, _ := api.NewClient(api.DefaultConfig()) 22 | kv := client.KV() 23 | 24 | // PUT a new KV pair 25 | p := &api.KVPair{Key: "foo", Value: []byte("test")} 26 | _, err := kv.Put(p, nil) 27 | if err != nil { 28 | panic(err) 29 | } 30 | 31 | // Lookup the pair 32 | pair, _, err := kv.Get("foo", nil) 33 | if err != nil { 34 | panic(err) 35 | } 36 | fmt.Printf("KV: %v", pair) 37 | 38 | ``` 39 | 40 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/criu_opts.go: -------------------------------------------------------------------------------- 1 | package libcontainer 2 | 3 | type CriuPageServerInfo struct { 4 | Address string // IP address of CRIU page server 5 | Port int32 // port number of CRIU page server 6 | } 7 | 8 | type CriuOpts struct { 9 | ImagesDirectory string // directory for storing image files 10 | WorkDirectory string // directory to cd and write logs/pidfiles/stats to 11 | LeaveRunning bool // leave container in running state after checkpoint 12 | TcpEstablished bool // checkpoint/restore established TCP connections 13 | ExternalUnixConnections bool // allow external unix connections 14 | ShellJob bool // allow to dump and restore shell jobs 15 | FileLocks bool // handle file locks, for safety 16 | PageServer CriuPageServerInfo // allow to dump to criu page server 17 | } 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/coreos/etcd/pkg/types/slice.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package types 16 | 17 | // Uint64Slice implements sort interface 18 | type Uint64Slice []uint64 19 | 20 | func (p Uint64Slice) Len() int { return len(p) } 21 | func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } 22 | func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } 23 | -------------------------------------------------------------------------------- /testutils/context.go: -------------------------------------------------------------------------------- 1 | package testutils 2 | 3 | import ( 4 | "runtime" 5 | "syscall" 6 | "testing" 7 | 8 | "github.com/docker/libnetwork/ns" 9 | ) 10 | 11 | // SetupTestOSContext joins a new network namespace, and returns its associated 12 | // teardown function. 13 | // 14 | // Example usage: 15 | // 16 | // defer SetupTestOSContext(t)() 17 | // 18 | func SetupTestOSContext(t *testing.T) func() { 19 | runtime.LockOSThread() 20 | if err := syscall.Unshare(syscall.CLONE_NEWNET); err != nil { 21 | t.Fatalf("Failed to enter netns: %v", err) 22 | } 23 | 24 | fd, err := syscall.Open("/proc/self/ns/net", syscall.O_RDONLY, 0) 25 | if err != nil { 26 | t.Fatal("Failed to open netns file") 27 | } 28 | 29 | // Since we are switching to a new test namespace make 30 | // sure to re-initialize initNs context 31 | ns.Init() 32 | 33 | return func() { 34 | if err := syscall.Close(fd); err != nil { 35 | t.Logf("Warning: netns closing failed (%v)", err) 36 | } 37 | runtime.UnlockOSThread() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "github.com/opencontainers/runc/libcontainer/cgroups" 5 | "github.com/opencontainers/runc/libcontainer/configs" 6 | ) 7 | 8 | type NetClsGroup struct { 9 | } 10 | 11 | func (s *NetClsGroup) Apply(d *data) error { 12 | dir, err := d.join("net_cls") 13 | if err != nil && !cgroups.IsNotFound(err) { 14 | return err 15 | } 16 | 17 | if err := s.Set(dir, d.c); err != nil { 18 | return err 19 | } 20 | 21 | return nil 22 | } 23 | 24 | func (s *NetClsGroup) Set(path string, cgroup *configs.Cgroup) error { 25 | if cgroup.NetClsClassid != "" { 26 | if err := writeFile(path, "net_cls.classid", cgroup.NetClsClassid); err != nil { 27 | return err 28 | } 29 | } 30 | 31 | return nil 32 | } 33 | 34 | func (s *NetClsGroup) Remove(d *data) error { 35 | return removePath(d.path("net_cls")) 36 | } 37 | 38 | func (s *NetClsGroup) GetStats(path string, stats *cgroups.Stats) error { 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/rootfs_linux_test.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package libcontainer 4 | 5 | import "testing" 6 | 7 | func TestCheckMountDestOnProc(t *testing.T) { 8 | dest := "/rootfs/proc/" 9 | err := checkMountDestination("/rootfs", dest) 10 | if err == nil { 11 | t.Fatal("destination inside proc should return an error") 12 | } 13 | } 14 | 15 | func TestCheckMountDestInSys(t *testing.T) { 16 | dest := "/rootfs//sys/fs/cgroup" 17 | err := checkMountDestination("/rootfs", dest) 18 | if err != nil { 19 | t.Fatal("destination inside /sys should not return an error") 20 | } 21 | } 22 | 23 | func TestCheckMountDestFalsePositive(t *testing.T) { 24 | dest := "/rootfs/sysfiles/fs/cgroup" 25 | err := checkMountDestination("/rootfs", dest) 26 | if err != nil { 27 | t.Fatal(err) 28 | } 29 | } 30 | 31 | func TestCheckMountRoot(t *testing.T) { 32 | dest := "/rootfs" 33 | err := checkMountDestination("/rootfs", dest) 34 | if err == nil { 35 | t.Fatal(err) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /osl/sandbox_freebsd.go: -------------------------------------------------------------------------------- 1 | package osl 2 | 3 | import "testing" 4 | 5 | // GenerateKey generates a sandbox key based on the passed 6 | // container id. 7 | func GenerateKey(containerID string) string { 8 | maxLen := 12 9 | if len(containerID) < maxLen { 10 | maxLen = len(containerID) 11 | } 12 | 13 | return containerID[:maxLen] 14 | } 15 | 16 | // NewSandbox provides a new sandbox instance created in an os specific way 17 | // provided a key which uniquely identifies the sandbox 18 | func NewSandbox(key string, osCreate bool) (Sandbox, error) { 19 | return nil, nil 20 | } 21 | 22 | // GC triggers garbage collection of namespace path right away 23 | // and waits for it. 24 | func GC() { 25 | } 26 | 27 | // InitOSContext initializes OS context while configuring network resources 28 | func InitOSContext() func() { 29 | return func() {} 30 | } 31 | 32 | // SetupTestOSContext sets up a separate test OS context in which tests will be executed. 33 | func SetupTestOSContext(t *testing.T) func() { 34 | return func() {} 35 | } 36 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | This document defines the high-level goals of the libnetwork project. See [Project Planning](#project-planning) for information on Releases. 4 | 5 | ## Long-term Goal 6 | 7 | libnetwork project will follow Docker and Linux philosophy of delivering small, highly modular and composable tools that works well independently. 8 | libnetwork aims to satisfy that composable need for Networking in Containers. 9 | 10 | ## Short-term Goals 11 | 12 | - Modularize the networking logic in Docker Engine and libcontainer in to a single, reusable library 13 | - Replace the networking subsystem of Docker Engine, with libnetwork 14 | - Define a flexible model that allows local and remote drivers to provide networking to containers 15 | - Provide a stand-alone tool "dnet" for managing and testing libnetwork 16 | 17 | Project Planning 18 | ================ 19 | 20 | [Project Pages](https://github.com/docker/libnetwork/wiki) define the goals for each Milestone and identify the release-relationship to the Docker Platform. 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/unpause.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | 6 | flag "github.com/docker/docker/pkg/mflag" 7 | ) 8 | 9 | // CmdUnpause unpauses all processes within a container, for one or more containers. 10 | // 11 | // Usage: docker unpause CONTAINER [CONTAINER...] 12 | func (cli *DockerCli) CmdUnpause(args ...string) error { 13 | cmd := cli.Subcmd("unpause", "CONTAINER [CONTAINER...]", "Unpause all processes within a container", true) 14 | cmd.Require(flag.Min, 1) 15 | cmd.ParseFlags(args, true) 16 | 17 | var errNames []string 18 | for _, name := range cmd.Args() { 19 | if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/unpause", name), nil, nil)); err != nil { 20 | fmt.Fprintf(cli.err, "%s\n", err) 21 | errNames = append(errNames, name) 22 | } else { 23 | fmt.Fprintf(cli.out, "%s\n", name) 24 | } 25 | } 26 | if len(errNames) > 0 { 27 | return fmt.Errorf("Error: failed to unpause containers: %v", errNames) 28 | } 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs/mount.go: -------------------------------------------------------------------------------- 1 | package configs 2 | 3 | type Mount struct { 4 | // Source path for the mount. 5 | Source string `json:"source"` 6 | 7 | // Destination path for the mount inside the container. 8 | Destination string `json:"destination"` 9 | 10 | // Device the mount is for. 11 | Device string `json:"device"` 12 | 13 | // Mount flags. 14 | Flags int `json:"flags"` 15 | 16 | // Mount data applied to the mount. 17 | Data string `json:"data"` 18 | 19 | // Relabel source if set, "z" indicates shared, "Z" indicates unshared. 20 | Relabel string `json:"relabel"` 21 | 22 | // Optional Command to be run before Source is mounted. 23 | PremountCmds []Command `json:"premount_cmds"` 24 | 25 | // Optional Command to be run after Source is mounted. 26 | PostmountCmds []Command `json:"postmount_cmds"` 27 | } 28 | 29 | type Command struct { 30 | Path string `json:"path"` 31 | Args []string `json:"args"` 32 | Env []string `json:"env"` 33 | Dir string `json:"dir"` 34 | } 35 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/coreos/etcd/pkg/types/slice_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package types 16 | 17 | import ( 18 | "reflect" 19 | "sort" 20 | "testing" 21 | ) 22 | 23 | func TestUint64Slice(t *testing.T) { 24 | g := Uint64Slice{10, 500, 5, 1, 100, 25} 25 | w := Uint64Slice{1, 5, 10, 25, 100, 500} 26 | sort.Sort(g) 27 | if !reflect.DeepEqual(g, w) { 28 | t.Errorf("slice after sort = %#v, want %#v", g, w) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "github.com/opencontainers/runc/libcontainer/cgroups" 5 | "github.com/opencontainers/runc/libcontainer/configs" 6 | ) 7 | 8 | type NetPrioGroup struct { 9 | } 10 | 11 | func (s *NetPrioGroup) Apply(d *data) error { 12 | dir, err := d.join("net_prio") 13 | if err != nil && !cgroups.IsNotFound(err) { 14 | return err 15 | } 16 | 17 | if err := s.Set(dir, d.c); err != nil { 18 | return err 19 | } 20 | 21 | return nil 22 | } 23 | 24 | func (s *NetPrioGroup) Set(path string, cgroup *configs.Cgroup) error { 25 | for _, prioMap := range cgroup.NetPrioIfpriomap { 26 | if err := writeFile(path, "net_prio.ifpriomap", prioMap.CgroupString()); err != nil { 27 | return err 28 | } 29 | } 30 | 31 | return nil 32 | } 33 | 34 | func (s *NetPrioGroup) Remove(d *data) error { 35 | return removePath(d.path("net_prio")) 36 | } 37 | 38 | func (s *NetPrioGroup) GetStats(path string, stats *cgroups.Stats) error { 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /drivers/bridge/interface_test.go: -------------------------------------------------------------------------------- 1 | package bridge 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/docker/libnetwork/testutils" 7 | "github.com/vishvananda/netlink" 8 | ) 9 | 10 | func TestInterfaceDefaultName(t *testing.T) { 11 | defer testutils.SetupTestOSContext(t)() 12 | 13 | config := &networkConfiguration{} 14 | if _ = newInterface(config); config.BridgeName != DefaultBridgeName { 15 | t.Fatalf("Expected default interface name %q, got %q", DefaultBridgeName, config.BridgeName) 16 | } 17 | } 18 | 19 | func TestAddressesEmptyInterface(t *testing.T) { 20 | defer testutils.SetupTestOSContext(t)() 21 | 22 | inf := newInterface(&networkConfiguration{}) 23 | addrv4, addrsv6, err := inf.addresses() 24 | if err != nil { 25 | t.Fatalf("Failed to get addresses of default interface: %v", err) 26 | } 27 | if expected := (netlink.Addr{}); addrv4 != expected { 28 | t.Fatalf("Default interface has unexpected IPv4: %s", addrv4) 29 | } 30 | if len(addrsv6) != 0 { 31 | t.Fatalf("Default interface has unexpected IPv6: %v", addrsv6) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/swarm/discovery/token/README.md: -------------------------------------------------------------------------------- 1 | #discovery-stage.hub.docker.com 2 | 3 | Docker Swarm comes with a simple discovery service built into the [Docker Hub](http://hub.docker.com) 4 | 5 | The discovery service is still in alpha stage and currently hosted at `https://discovery-stage.hub.docker.com` 6 | 7 | #####Create a new cluster 8 | `-> POST https://discovery-stage.hub.docker.com/v1/clusters` 9 | 10 | `<- ` 11 | 12 | #####Add new nodes to a cluster 13 | `-> POST https://discovery-stage.hub.docker.com/v1/clusters/ Request body: ":"` 14 | 15 | `<- OK` 16 | 17 | `-> POST https://discovery-stage.hub.docker.com/v1/clusters/ Request body: ":")` 18 | 19 | `<- OK` 20 | 21 | 22 | #####List nodes in a cluster 23 | `-> GET https://discovery-stage.hub.docker.com/v1/clusters/` 24 | 25 | `<- [":", ":"]` 26 | 27 | 28 | #####Delete a cluster (all the nodes in a cluster) 29 | `-> DELETE https://discovery-stage.hub.docker.com/v1/clusters/` 30 | 31 | `<- OK` 32 | -------------------------------------------------------------------------------- /docs/legacy.md: -------------------------------------------------------------------------------- 1 | 2 | This document provides a TLD&R version of https://docs.docker.com/v1.6/articles/networking/. 3 | If more interested in detailed operational design, please refer to this link. 4 | 5 | ## Docker Networking design as of Docker v1.6 6 | 7 | Prior to libnetwork, Docker Networking was handled in both Docker Engine and libcontainer. 8 | Docker Engine makes use of the Bridge Driver to provide single-host networking solution with the help of linux bridge and IPTables. 9 | Docker Engine provides simple configurations such as `--link`, `--expose`,... to enable container connectivity within the same host by abstracting away networking configuration completely from the Containers. 10 | For external connectivity, it relied upon NAT & Port-mapping 11 | 12 | Docker Engine was responsible for providing the configuration for the container's networking stack. 13 | 14 | Libcontainer would then use this information to create the necessary networking devices and move them in to a network namespace. 15 | This namespace would then be used when the container is started. 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/devices/number.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package devices 4 | 5 | /* 6 | 7 | This code provides support for manipulating linux device numbers. It should be replaced by normal syscall functions once http://code.google.com/p/go/issues/detail?id=8106 is solved. 8 | 9 | You can read what they are here: 10 | 11 | - http://www.makelinux.net/ldd3/chp-3-sect-2 12 | - http://www.linux-tutorial.info/modules.php?name=MContent&pageid=94 13 | 14 | Note! These are NOT the same as the MAJOR(dev_t device);, MINOR(dev_t device); and MKDEV(int major, int minor); functions as defined in as the representation of device numbers used by go is different than the one used internally to the kernel! - https://github.com/torvalds/linux/blob/master/include/linux/kdev_t.h#L9 15 | 16 | */ 17 | 18 | func Major(devNumber int) int64 { 19 | return int64((devNumber >> 8) & 0xfff) 20 | } 21 | 22 | func Minor(devNumber int) int64 { 23 | return int64((devNumber & 0xff) | ((devNumber >> 12) & 0xfff00)) 24 | } 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/meminfo_linux_test.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | 7 | "github.com/docker/docker/pkg/units" 8 | ) 9 | 10 | // TestMemInfo tests parseMemInfo with a static meminfo string 11 | func TestMemInfo(t *testing.T) { 12 | const input = ` 13 | MemTotal: 1 kB 14 | MemFree: 2 kB 15 | SwapTotal: 3 kB 16 | SwapFree: 4 kB 17 | Malformed1: 18 | Malformed2: 1 19 | Malformed3: 2 MB 20 | Malformed4: X kB 21 | ` 22 | meminfo, err := parseMemInfo(strings.NewReader(input)) 23 | if err != nil { 24 | t.Fatal(err) 25 | } 26 | if meminfo.MemTotal != 1*units.KiB { 27 | t.Fatalf("Unexpected MemTotal: %d", meminfo.MemTotal) 28 | } 29 | if meminfo.MemFree != 2*units.KiB { 30 | t.Fatalf("Unexpected MemFree: %d", meminfo.MemFree) 31 | } 32 | if meminfo.SwapTotal != 3*units.KiB { 33 | t.Fatalf("Unexpected SwapTotal: %d", meminfo.SwapTotal) 34 | } 35 | if meminfo.SwapFree != 4*units.KiB { 36 | t.Fatalf("Unexpected SwapFree: %d", meminfo.SwapFree) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/README.md: -------------------------------------------------------------------------------- 1 | Package mflag (aka multiple-flag) implements command-line flag parsing. 2 | It's an **hacky** fork of the [official golang package](http://golang.org/pkg/flag/) 3 | 4 | It adds: 5 | 6 | * both short and long flag version 7 | `./example -s red` `./example --string blue` 8 | 9 | * multiple names for the same option 10 | ``` 11 | $>./example -h 12 | Usage of example: 13 | -s, --string="": a simple string 14 | ``` 15 | 16 | ___ 17 | It is very flexible on purpose, so you can do things like: 18 | ``` 19 | $>./example -h 20 | Usage of example: 21 | -s, -string, --string="": a simple string 22 | ``` 23 | 24 | Or: 25 | ``` 26 | $>./example -h 27 | Usage of example: 28 | -oldflag, --newflag="": a simple string 29 | ``` 30 | 31 | You can also hide some flags from the usage, so if we want only `--newflag`: 32 | ``` 33 | $>./example -h 34 | Usage of example: 35 | --newflag="": a simple string 36 | $>./example -oldflag str 37 | str 38 | ``` 39 | 40 | See [example.go](example/example.go) for more details. 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/coreos/etcd/client/cluster_error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package client 16 | 17 | import "fmt" 18 | 19 | type ClusterError struct { 20 | Errors []error 21 | } 22 | 23 | func (ce *ClusterError) Error() string { 24 | return ErrClusterUnavailable.Error() 25 | } 26 | 27 | func (ce *ClusterError) Detail() string { 28 | s := "" 29 | for i, e := range ce.Errors { 30 | s += fmt.Sprintf("error #%d: %s\n", i, e) 31 | } 32 | return s 33 | } 34 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/wait.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | 6 | flag "github.com/docker/docker/pkg/mflag" 7 | ) 8 | 9 | // CmdWait blocks until a container stops, then prints its exit code. 10 | // 11 | // If more than one container is specified, this will wait synchronously on each container. 12 | // 13 | // Usage: docker wait CONTAINER [CONTAINER...] 14 | func (cli *DockerCli) CmdWait(args ...string) error { 15 | cmd := cli.Subcmd("wait", "CONTAINER [CONTAINER...]", "Block until a container stops, then print its exit code.", true) 16 | cmd.Require(flag.Min, 1) 17 | 18 | cmd.ParseFlags(args, true) 19 | 20 | var errNames []string 21 | for _, name := range cmd.Args() { 22 | status, err := waitForExit(cli, name) 23 | if err != nil { 24 | fmt.Fprintf(cli.err, "%s\n", err) 25 | errNames = append(errNames, name) 26 | } else { 27 | fmt.Fprintf(cli.out, "%d\n", status) 28 | } 29 | } 30 | if len(errNames) > 0 { 31 | return fmt.Errorf("Error: failed to wait containers: %v", errNames) 32 | } 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/listenbuffer/listen_buffer_test.go: -------------------------------------------------------------------------------- 1 | package listenbuffer 2 | 3 | import ( 4 | "io/ioutil" 5 | "net" 6 | "testing" 7 | ) 8 | 9 | func TestListenBufferAllowsAcceptingWhenActivated(t *testing.T) { 10 | lock := make(chan struct{}) 11 | buffer, err := NewListenBuffer("tcp", "", lock) 12 | if err != nil { 13 | t.Fatal("Unable to create listen buffer: ", err) 14 | } 15 | 16 | go func() { 17 | conn, err := net.Dial("tcp", buffer.Addr().String()) 18 | if err != nil { 19 | t.Fatal("Client failed to establish connection to server: ", err) 20 | } 21 | 22 | conn.Write([]byte("ping")) 23 | conn.Close() 24 | }() 25 | 26 | close(lock) 27 | 28 | client, err := buffer.Accept() 29 | if err != nil { 30 | t.Fatal("Failed to accept client: ", err) 31 | } 32 | 33 | response, err := ioutil.ReadAll(client) 34 | if err != nil { 35 | t.Fatal("Failed to read from client: ", err) 36 | } 37 | 38 | if string(response) != "ping" { 39 | t.Fatal("Expected to receive ping from client, received: ", string(response)) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ns/init_linux.go: -------------------------------------------------------------------------------- 1 | package ns 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "syscall" 7 | 8 | log "github.com/Sirupsen/logrus" 9 | "github.com/vishvananda/netns" 10 | ) 11 | 12 | var initNs netns.NsHandle 13 | 14 | // Init initializes a new network namespace 15 | func Init() { 16 | var err error 17 | initNs, err = netns.Get() 18 | if err != nil { 19 | log.Errorf("could not get initial namespace: %v", err) 20 | } 21 | } 22 | 23 | // SetNamespace sets the initial namespace handler 24 | func SetNamespace() error { 25 | if err := netns.Set(initNs); err != nil { 26 | linkInfo, linkErr := getLink() 27 | if linkErr != nil { 28 | linkInfo = linkErr.Error() 29 | } 30 | 31 | return fmt.Errorf("failed to set to initial namespace, %v, initns fd %d: %v", linkInfo, initNs, err) 32 | } 33 | return nil 34 | } 35 | 36 | // ParseHandlerInt transforms the namespace handler into a integer 37 | func ParseHandlerInt() int { 38 | return int(initNs) 39 | } 40 | 41 | func getLink() (string, error) { 42 | return os.Readlink(fmt.Sprintf("/proc/%d/task/%d/ns/net", os.Getpid(), syscall.Gettid())) 43 | } 44 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/parsers/operatingsystem/operatingsystem_linux.go: -------------------------------------------------------------------------------- 1 | package operatingsystem 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | "io/ioutil" 7 | ) 8 | 9 | var ( 10 | // file to use to detect if the daemon is running in a container 11 | proc1Cgroup = "/proc/1/cgroup" 12 | 13 | // file to check to determine Operating System 14 | etcOsRelease = "/etc/os-release" 15 | ) 16 | 17 | func GetOperatingSystem() (string, error) { 18 | b, err := ioutil.ReadFile(etcOsRelease) 19 | if err != nil { 20 | return "", err 21 | } 22 | if i := bytes.Index(b, []byte("PRETTY_NAME")); i >= 0 { 23 | b = b[i+13:] 24 | return string(b[:bytes.IndexByte(b, '"')]), nil 25 | } 26 | return "", errors.New("PRETTY_NAME not found") 27 | } 28 | 29 | func IsContainerized() (bool, error) { 30 | b, err := ioutil.ReadFile(proc1Cgroup) 31 | if err != nil { 32 | return false, err 33 | } 34 | for _, line := range bytes.Split(b, []byte{'\n'}) { 35 | if len(line) > 0 && !bytes.HasSuffix(line, []byte{'/'}) { 36 | return true, nil 37 | } 38 | } 39 | return false, nil 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/godbus/dbus/examples_test.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import "fmt" 4 | 5 | func ExampleConn_Emit() { 6 | conn, err := SessionBus() 7 | if err != nil { 8 | panic(err) 9 | } 10 | 11 | conn.Emit("/foo/bar", "foo.bar.Baz", uint32(0xDAEDBEEF)) 12 | } 13 | 14 | func ExampleObject_Call() { 15 | var list []string 16 | 17 | conn, err := SessionBus() 18 | if err != nil { 19 | panic(err) 20 | } 21 | 22 | err = conn.BusObject().Call("org.freedesktop.DBus.ListNames", 0).Store(&list) 23 | if err != nil { 24 | panic(err) 25 | } 26 | for _, v := range list { 27 | fmt.Println(v) 28 | } 29 | } 30 | 31 | func ExampleObject_Go() { 32 | conn, err := SessionBus() 33 | if err != nil { 34 | panic(err) 35 | } 36 | 37 | ch := make(chan *Call, 10) 38 | conn.BusObject().Go("org.freedesktop.DBus.ListActivatableNames", 0, ch) 39 | select { 40 | case call := <-ch: 41 | if call.Err != nil { 42 | panic(err) 43 | } 44 | list := call.Body[0].([]string) 45 | for _, v := range list { 46 | fmt.Println(v) 47 | } 48 | // put some other cases here 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/setns_init_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package libcontainer 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/opencontainers/runc/libcontainer/apparmor" 9 | "github.com/opencontainers/runc/libcontainer/label" 10 | "github.com/opencontainers/runc/libcontainer/system" 11 | ) 12 | 13 | // linuxSetnsInit performs the container's initialization for running a new process 14 | // inside an existing container. 15 | type linuxSetnsInit struct { 16 | config *initConfig 17 | } 18 | 19 | func (l *linuxSetnsInit) Init() error { 20 | if err := setupRlimits(l.config.Config); err != nil { 21 | return err 22 | } 23 | if err := finalizeNamespace(l.config); err != nil { 24 | return err 25 | } 26 | if err := apparmor.ApplyProfile(l.config.Config.AppArmorProfile); err != nil { 27 | return err 28 | } 29 | if l.config.Config.ProcessLabel != "" { 30 | if err := label.SetProcessLabel(l.config.Config.ProcessLabel); err != nil { 31 | return err 32 | } 33 | } 34 | return system.Execv(l.config.Args[0], l.config.Args[0:], os.Environ()) 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/load.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "os" 6 | 7 | flag "github.com/docker/docker/pkg/mflag" 8 | ) 9 | 10 | // CmdLoad loads an image from a tar archive. 11 | // 12 | // The tar archive is read from STDIN by default, or from a tar archive file. 13 | // 14 | // Usage: docker load [OPTIONS] 15 | func (cli *DockerCli) CmdLoad(args ...string) error { 16 | cmd := cli.Subcmd("load", "", "Load an image from a tar archive on STDIN", true) 17 | infile := cmd.String([]string{"i", "-input"}, "", "Read from a tar archive file, instead of STDIN") 18 | cmd.Require(flag.Exact, 0) 19 | 20 | cmd.ParseFlags(args, true) 21 | 22 | var ( 23 | input io.Reader = cli.in 24 | err error 25 | ) 26 | if *infile != "" { 27 | input, err = os.Open(*infile) 28 | if err != nil { 29 | return err 30 | } 31 | } 32 | sopts := &streamOpts{ 33 | rawTerminal: true, 34 | in: input, 35 | out: cli.out, 36 | } 37 | if err := cli.stream("POST", "/images/load", sopts); err != nil { 38 | return err 39 | } 40 | return nil 41 | } 42 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls_test.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | const ( 8 | classidBefore = "0x100002" 9 | classidAfter = "0x100001" 10 | ) 11 | 12 | func TestNetClsSetClassid(t *testing.T) { 13 | helper := NewCgroupTestUtil("net_cls", t) 14 | defer helper.cleanup() 15 | 16 | helper.writeFileContents(map[string]string{ 17 | "net_cls.classid": classidBefore, 18 | }) 19 | 20 | helper.CgroupData.c.NetClsClassid = classidAfter 21 | netcls := &NetClsGroup{} 22 | if err := netcls.Set(helper.CgroupPath, helper.CgroupData.c); err != nil { 23 | t.Fatal(err) 24 | } 25 | 26 | // As we are in mock environment, we can't get correct value of classid from 27 | // net_cls.classid. 28 | // So. we just judge if we successfully write classid into file 29 | value, err := getCgroupParamString(helper.CgroupPath, "net_cls.classid") 30 | if err != nil { 31 | t.Fatalf("Failed to parse net_cls.classid - %s", err) 32 | } 33 | if value != classidAfter { 34 | t.Fatal("Got the wrong value, set net_cls.classid failed.") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/listenbuffer/README.md: -------------------------------------------------------------------------------- 1 | # listenbuffer 2 | 3 | listenbuffer uses the kernel's listening backlog functionality to queue 4 | connections, allowing applications to start listening immediately and handle 5 | connections later. This is signaled by closing the activation channel passed to 6 | the constructor. 7 | 8 | The maximum amount of queued connections depends on the configuration of your 9 | kernel (typically called SOMAXXCON) and cannot be configured in Go with the 10 | net package. See `src/net/sock_platform.go` in the Go tree or consult your 11 | kernel's manual. 12 | 13 | activator := make(chan struct{}) 14 | buffer, err := NewListenBuffer("tcp", "localhost:4000", activator) 15 | if err != nil { 16 | panic(err) 17 | } 18 | 19 | // will block until activator has been closed or is sent an event 20 | client, err := buffer.Accept() 21 | 22 | Somewhere else in your application once it's been booted: 23 | 24 | close(activator) 25 | 26 | `buffer.Accept()` will return the first client in the kernel listening queue, or 27 | continue to block until a client connects or an error occurs. 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go: -------------------------------------------------------------------------------- 1 | // +build apparmor,linux 2 | 3 | package apparmor 4 | 5 | // #cgo LDFLAGS: -lapparmor 6 | // #include 7 | // #include 8 | import "C" 9 | import ( 10 | "io/ioutil" 11 | "os" 12 | "unsafe" 13 | ) 14 | 15 | // IsEnabled returns true if apparmor is enabled for the host. 16 | func IsEnabled() bool { 17 | if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil && os.Getenv("container") == "" { 18 | if _, err = os.Stat("/sbin/apparmor_parser"); err == nil { 19 | buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled") 20 | return err == nil && len(buf) > 1 && buf[0] == 'Y' 21 | } 22 | } 23 | return false 24 | } 25 | 26 | // ApplyProfile will apply the profile with the specified name to the process after 27 | // the next exec. 28 | func ApplyProfile(name string) error { 29 | if name == "" { 30 | return nil 31 | } 32 | cName := C.CString(name) 33 | defer C.free(unsafe.Pointer(cName)) 34 | if _, err := C.aa_change_onexec(cName); err != nil { 35 | return err 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /osl/namespace_windows.go: -------------------------------------------------------------------------------- 1 | package osl 2 | 3 | import "testing" 4 | 5 | // GenerateKey generates a sandbox key based on the passed 6 | // container id. 7 | func GenerateKey(containerID string) string { 8 | maxLen := 12 9 | if len(containerID) < maxLen { 10 | maxLen = len(containerID) 11 | } 12 | 13 | return containerID[:maxLen] 14 | } 15 | 16 | // NewSandbox provides a new sandbox instance created in an os specific way 17 | // provided a key which uniquely identifies the sandbox 18 | func NewSandbox(key string, osCreate bool) (Sandbox, error) { 19 | return nil, nil 20 | } 21 | 22 | func GetSandboxForExternalKey(path string, key string) (Sandbox, error) { 23 | return nil, nil 24 | } 25 | 26 | // GC triggers garbage collection of namespace path right away 27 | // and waits for it. 28 | func GC() { 29 | } 30 | 31 | // InitOSContext initializes OS context while configuring network resources 32 | func InitOSContext() func() { 33 | return func() {} 34 | } 35 | 36 | // SetupTestOSContext sets up a separate test OS context in which tests will be executed. 37 | func SetupTestOSContext(t *testing.T) func() { 38 | return func() {} 39 | } 40 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/codegangsta/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) { 14 | // println("Greetings") 15 | // } 16 | // 17 | // app.Run(os.Args) 18 | // } 19 | package cli 20 | 21 | import ( 22 | "strings" 23 | ) 24 | 25 | type MultiError struct { 26 | Errors []error 27 | } 28 | 29 | func NewMultiError(err ...error) MultiError { 30 | return MultiError{Errors: err} 31 | } 32 | 33 | func (m MultiError) Error() string { 34 | errs := make([]string, len(m.Errors)) 35 | for i, err := range m.Errors { 36 | errs[i] = err.Error() 37 | } 38 | 39 | return strings.Join(errs, "\n") 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/system/utimes_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the speficied path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | // These are not currently available in syscall 12 | atFdCwd := -100 13 | atSymLinkNoFollow := 0x100 14 | 15 | var _path *byte 16 | _path, err := syscall.BytePtrFromString(path) 17 | if err != nil { 18 | return err 19 | } 20 | 21 | if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(atFdCwd), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(atSymLinkNoFollow), 0, 0); err != 0 && err != syscall.ENOSYS { 22 | return err 23 | } 24 | 25 | return nil 26 | } 27 | 28 | // UtimesNano is used to change access and modification time of the specified path. 29 | // It can't be used for symbol link file. 30 | func UtimesNano(path string, ts []syscall.Timespec) error { 31 | return syscall.UtimesNano(path, ts) 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/script/.validate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$VALIDATE_UPSTREAM" ]; then 4 | # this is kind of an expensive check, so let's not do this twice if we 5 | # are running more than one validate bundlescript 6 | 7 | VALIDATE_REPO='https://github.com/docker/libkv.git' 8 | VALIDATE_BRANCH='master' 9 | 10 | if [ "$TRAVIS" = 'true' -a "$TRAVIS_PULL_REQUEST" != 'false' ]; then 11 | VALIDATE_REPO="https://github.com/${TRAVIS_REPO_SLUG}.git" 12 | VALIDATE_BRANCH="${TRAVIS_BRANCH}" 13 | fi 14 | 15 | VALIDATE_HEAD="$(git rev-parse --verify HEAD)" 16 | 17 | git fetch -q "$VALIDATE_REPO" "refs/heads/$VALIDATE_BRANCH" 18 | VALIDATE_UPSTREAM="$(git rev-parse --verify FETCH_HEAD)" 19 | 20 | VALIDATE_COMMIT_LOG="$VALIDATE_UPSTREAM..$VALIDATE_HEAD" 21 | VALIDATE_COMMIT_DIFF="$VALIDATE_UPSTREAM...$VALIDATE_HEAD" 22 | 23 | validate_diff() { 24 | if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then 25 | git diff "$VALIDATE_COMMIT_DIFF" "$@" 26 | fi 27 | } 28 | validate_log() { 29 | if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then 30 | git log "$VALIDATE_COMMIT_LOG" "$@" 31 | fi 32 | } 33 | fi 34 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/api/client/kill.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | 6 | flag "github.com/docker/docker/pkg/mflag" 7 | ) 8 | 9 | // CmdKill kills one or more running container using SIGKILL or a specified signal. 10 | // 11 | // Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...] 12 | func (cli *DockerCli) CmdKill(args ...string) error { 13 | cmd := cli.Subcmd("kill", "CONTAINER [CONTAINER...]", "Kill a running container using SIGKILL or a specified signal", true) 14 | signal := cmd.String([]string{"s", "-signal"}, "KILL", "Signal to send to the container") 15 | cmd.Require(flag.Min, 1) 16 | 17 | cmd.ParseFlags(args, true) 18 | 19 | var errNames []string 20 | for _, name := range cmd.Args() { 21 | if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/kill?signal=%s", name, *signal), nil, nil)); err != nil { 22 | fmt.Fprintf(cli.err, "%s\n", err) 23 | errNames = append(errNames, name) 24 | } else { 25 | fmt.Fprintf(cli.out, "%s\n", name) 26 | } 27 | } 28 | if len(errNames) > 0 { 29 | return fmt.Errorf("Error: failed to kill containers: %v", errNames) 30 | } 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | /* 4 | #include 5 | #include 6 | #include 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | "reflect" 13 | "unsafe" 14 | ) 15 | 16 | // Parse /proc/self/mountinfo because comparing Dev and ino does not work from 17 | // bind mounts. 18 | func parseMountTable() ([]*Info, error) { 19 | var rawEntries *C.struct_statfs 20 | 21 | count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) 22 | if count == 0 { 23 | return nil, fmt.Errorf("Failed to call getmntinfo") 24 | } 25 | 26 | var entries []C.struct_statfs 27 | header := (*reflect.SliceHeader)(unsafe.Pointer(&entries)) 28 | header.Cap = count 29 | header.Len = count 30 | header.Data = uintptr(unsafe.Pointer(rawEntries)) 31 | 32 | var out []*Info 33 | for _, entry := range entries { 34 | var mountinfo Info 35 | mountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0]) 36 | mountinfo.Source = C.GoString(&entry.f_mntfromname[0]) 37 | mountinfo.Fstype = C.GoString(&entry.f_fstypename[0]) 38 | out = append(out, &mountinfo) 39 | } 40 | return out, nil 41 | } 42 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/bolt_test.go: -------------------------------------------------------------------------------- 1 | package bolt_test 2 | 3 | import ( 4 | "fmt" 5 | "path/filepath" 6 | "reflect" 7 | "runtime" 8 | "testing" 9 | ) 10 | 11 | // assert fails the test if the condition is false. 12 | func assert(tb testing.TB, condition bool, msg string, v ...interface{}) { 13 | if !condition { 14 | _, file, line, _ := runtime.Caller(1) 15 | fmt.Printf("\033[31m%s:%d: "+msg+"\033[39m\n\n", append([]interface{}{filepath.Base(file), line}, v...)...) 16 | tb.FailNow() 17 | } 18 | } 19 | 20 | // ok fails the test if an err is not nil. 21 | func ok(tb testing.TB, err error) { 22 | if err != nil { 23 | _, file, line, _ := runtime.Caller(1) 24 | fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error()) 25 | tb.FailNow() 26 | } 27 | } 28 | 29 | // equals fails the test if exp is not equal to act. 30 | func equals(tb testing.TB, exp, act interface{}) { 31 | if !reflect.DeepEqual(exp, act) { 32 | _, file, line, _ := runtime.Caller(1) 33 | fmt.Printf("\033[31m%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\033[39m\n\n", filepath.Base(file), line, exp, act) 34 | tb.FailNow() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/hashicorp/consul/api/status.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Status can be used to query the Status endpoints 4 | type Status struct { 5 | c *Client 6 | } 7 | 8 | // Status returns a handle to the status endpoints 9 | func (c *Client) Status() *Status { 10 | return &Status{c} 11 | } 12 | 13 | // Leader is used to query for a known leader 14 | func (s *Status) Leader() (string, error) { 15 | r := s.c.newRequest("GET", "/v1/status/leader") 16 | _, resp, err := requireOK(s.c.doRequest(r)) 17 | if err != nil { 18 | return "", err 19 | } 20 | defer resp.Body.Close() 21 | 22 | var leader string 23 | if err := decodeBody(resp, &leader); err != nil { 24 | return "", err 25 | } 26 | return leader, nil 27 | } 28 | 29 | // Peers is used to query for a known raft peers 30 | func (s *Status) Peers() ([]string, error) { 31 | r := s.c.newRequest("GET", "/v1/status/peers") 32 | _, resp, err := requireOK(s.c.doRequest(r)) 33 | if err != nil { 34 | return nil, err 35 | } 36 | defer resp.Body.Close() 37 | 38 | var peers []string 39 | if err := decodeBody(resp, &peers); err != nil { 40 | return nil, err 41 | } 42 | return peers, nil 43 | } 44 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/README.md: -------------------------------------------------------------------------------- 1 | # codecgen tool 2 | 3 | Generate is given a list of *.go files to parse, and an output file (fout), 4 | codecgen will create an output file __file.go__ which 5 | contains `codec.Selfer` implementations for the named types found 6 | in the files parsed. 7 | 8 | Using codecgen is very straightforward. 9 | 10 | **Download and install the tool** 11 | 12 | `go get -u github.com/ugorji/go/codec/codecgen` 13 | 14 | **Run the tool on your files** 15 | 16 | The command line format is: 17 | 18 | `codecgen [options] (-o outfile) (infile ...)` 19 | 20 | ```sh 21 | % codecgen -? 22 | Usage of codecgen: 23 | -c="github.com/ugorji/go/codec": codec path 24 | -o="": out file 25 | -r=".*": regex for type name to match 26 | -rt="": tags for go run 27 | -t="": build tag to put in file 28 | -u=false: Use unsafe, e.g. to avoid unnecessary allocation on []byte->string 29 | -x=false: keep temp file 30 | 31 | % codecgen -o values_codecgen.go values.go values2.go moretypedefs.go 32 | ``` 33 | 34 | Please see the [blog article](http://ugorji.net/blog/go-codecgen) 35 | for more information on how to use the tool. 36 | 37 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/boltdb/bolt/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Ben Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/homedir/homedir.go: -------------------------------------------------------------------------------- 1 | package homedir 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | 7 | "github.com/opencontainers/runc/libcontainer/user" 8 | ) 9 | 10 | // Key returns the env var name for the user's home dir based on 11 | // the platform being run on 12 | func Key() string { 13 | if runtime.GOOS == "windows" { 14 | return "USERPROFILE" 15 | } 16 | return "HOME" 17 | } 18 | 19 | // Get returns the home directory of the current user with the help of 20 | // environment variables depending on the target operating system. 21 | // Returned path should be used with "path/filepath" to form new paths. 22 | func Get() string { 23 | home := os.Getenv(Key()) 24 | if home == "" && runtime.GOOS != "windows" { 25 | if u, err := user.CurrentUser(); err == nil { 26 | return u.Home 27 | } 28 | } 29 | return home 30 | } 31 | 32 | // GetShortcutString returns the string that is shortcut to user's home directory 33 | // in the native shell of the platform running on. 34 | func GetShortcutString() string { 35 | if runtime.GOOS == "windows" { 36 | return "%USERPROFILE%" // be careful while using in format functions 37 | } 38 | return "~" 39 | } 40 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/swarm/pkg/store/helpers.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // Creates a list of endpoints given the right scheme 8 | func createEndpoints(addrs []string, scheme string) (entries []string) { 9 | for _, addr := range addrs { 10 | entries = append(entries, scheme+"://"+addr) 11 | } 12 | return entries 13 | } 14 | 15 | // Normalize the key for each store to the form: 16 | // 17 | // /path/to/key 18 | // 19 | func normalize(key string) string { 20 | return "/" + join(splitKey(key)) 21 | } 22 | 23 | // Get the full directory part of the key to the form: 24 | // 25 | // /path/to/ 26 | // 27 | func getDirectory(key string) string { 28 | parts := splitKey(key) 29 | parts = parts[:len(parts)-1] 30 | return "/" + join(parts) 31 | } 32 | 33 | // SplitKey splits the key to extract path informations 34 | func splitKey(key string) (path []string) { 35 | if strings.Contains(key, "/") { 36 | path = strings.Split(key, "/") 37 | } else { 38 | path = []string{key} 39 | } 40 | return path 41 | } 42 | 43 | // Join the path parts with '/' 44 | func join(parts []string) string { 45 | return strings.Join(parts, "/") 46 | } 47 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/armon/go-metrics/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Armon Dadgar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libkv/libkv.go: -------------------------------------------------------------------------------- 1 | package libkv 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | "strings" 7 | 8 | "github.com/docker/libkv/store" 9 | ) 10 | 11 | // Initialize creates a new Store object, initializing the client 12 | type Initialize func(addrs []string, options *store.Config) (store.Store, error) 13 | 14 | var ( 15 | // Backend initializers 16 | initializers = make(map[store.Backend]Initialize) 17 | 18 | supportedBackend = func() string { 19 | keys := make([]string, 0, len(initializers)) 20 | for k := range initializers { 21 | keys = append(keys, string(k)) 22 | } 23 | sort.Strings(keys) 24 | return strings.Join(keys, ", ") 25 | }() 26 | ) 27 | 28 | // NewStore creates a an instance of store 29 | func NewStore(backend store.Backend, addrs []string, options *store.Config) (store.Store, error) { 30 | if init, exists := initializers[backend]; exists { 31 | return init(addrs, options) 32 | } 33 | 34 | return nil, fmt.Errorf("%s %s", store.ErrBackendNotSupported.Error(), supportedBackend) 35 | } 36 | 37 | // AddStore adds a new store backend to libkv 38 | func AddStore(store store.Backend, init Initialize) { 39 | initializers[store] = init 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netlink/addr.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | "strings" 7 | ) 8 | 9 | // Addr represents an IP address from netlink. Netlink ip addresses 10 | // include a mask, so it stores the address as a net.IPNet. 11 | type Addr struct { 12 | *net.IPNet 13 | Label string 14 | } 15 | 16 | // String returns $ip/$netmask $label 17 | func (a Addr) String() string { 18 | return fmt.Sprintf("%s %s", a.IPNet, a.Label) 19 | } 20 | 21 | // ParseAddr parses the string representation of an address in the 22 | // form $ip/$netmask $label. The label portion is optional 23 | func ParseAddr(s string) (*Addr, error) { 24 | label := "" 25 | parts := strings.Split(s, " ") 26 | if len(parts) > 1 { 27 | s = parts[0] 28 | label = parts[1] 29 | } 30 | m, err := ParseIPNet(s) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return &Addr{IPNet: m, Label: label}, nil 35 | } 36 | 37 | // Equal returns true if both Addrs have the same net.IPNet value. 38 | func (a Addr) Equal(x Addr) bool { 39 | sizea, _ := a.Mask.Size() 40 | sizeb, _ := x.Mask.Size() 41 | // ignore label for comparison 42 | return a.IP.Equal(x.IP) && sizea == sizeb 43 | } 44 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/vishvananda/netlink/nl/addr_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | type IfAddrmsg struct { 9 | syscall.IfAddrmsg 10 | } 11 | 12 | func NewIfAddrmsg(family int) *IfAddrmsg { 13 | return &IfAddrmsg{ 14 | IfAddrmsg: syscall.IfAddrmsg{ 15 | Family: uint8(family), 16 | }, 17 | } 18 | } 19 | 20 | // struct ifaddrmsg { 21 | // __u8 ifa_family; 22 | // __u8 ifa_prefixlen; /* The prefix length */ 23 | // __u8 ifa_flags; /* Flags */ 24 | // __u8 ifa_scope; /* Address scope */ 25 | // __u32 ifa_index; /* Link index */ 26 | // }; 27 | 28 | // type IfAddrmsg struct { 29 | // Family uint8 30 | // Prefixlen uint8 31 | // Flags uint8 32 | // Scope uint8 33 | // Index uint32 34 | // } 35 | // SizeofIfAddrmsg = 0x8 36 | 37 | func DeserializeIfAddrmsg(b []byte) *IfAddrmsg { 38 | return (*IfAddrmsg)(unsafe.Pointer(&b[0:syscall.SizeofIfAddrmsg][0])) 39 | } 40 | 41 | func (msg *IfAddrmsg) Serialize() []byte { 42 | return (*(*[syscall.SizeofIfAddrmsg]byte)(unsafe.Pointer(msg)))[:] 43 | } 44 | 45 | func (msg *IfAddrmsg) Len() int { 46 | return syscall.SizeofIfAddrmsg 47 | } 48 | --------------------------------------------------------------------------------