Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
903067c6
Commit
903067c6
authored
Apr 08, 2016
by
Tim St. Clair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update go-dockerclient godeps
Update go-dockerclient license
parent
e73606b9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
451 additions
and
56 deletions
+451
-56
Godeps.json
Godeps/Godeps.json
+1
-1
LICENSES
Godeps/LICENSES
+1
-1
.travis.yml
...rkspace/src/github.com/fsouza/go-dockerclient/.travis.yml
+12
-9
AUTHORS
.../_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS
+7
-0
LICENSE
.../_workspace/src/github.com/fsouza/go-dockerclient/LICENSE
+1
-1
Makefile
..._workspace/src/github.com/fsouza/go-dockerclient/Makefile
+13
-16
README.markdown
...ace/src/github.com/fsouza/go-dockerclient/README.markdown
+1
-1
auth.go
.../_workspace/src/github.com/fsouza/go-dockerclient/auth.go
+5
-3
client.go
...workspace/src/github.com/fsouza/go-dockerclient/client.go
+2
-0
container.go
...kspace/src/github.com/fsouza/go-dockerclient/container.go
+0
-0
event.go
..._workspace/src/github.com/fsouza/go-dockerclient/event.go
+71
-5
chtimes_unix.go
...ernal/github.com/docker/docker/pkg/system/chtimes_unix.go
+14
-0
chtimes_windows.go
...al/github.com/docker/docker/pkg/system/chtimes_windows.go
+27
-0
stat_openbsd.go
...ernal/github.com/docker/docker/pkg/system/stat_openbsd.go
+15
-0
stat_unsupported.go
...l/github.com/docker/docker/pkg/system/stat_unsupported.go
+1
-1
context.go
...dockerclient/external/golang.org/x/net/context/context.go
+6
-6
image.go
..._workspace/src/github.com/fsouza/go-dockerclient/image.go
+24
-0
misc.go
.../_workspace/src/github.com/fsouza/go-dockerclient/misc.go
+71
-4
network.go
...orkspace/src/github.com/fsouza/go-dockerclient/network.go
+60
-5
server.go
...e/src/github.com/fsouza/go-dockerclient/testing/server.go
+87
-3
install.bash
...ub.com/fsouza/go-dockerclient/travis-scripts/install.bash
+17
-0
run-tests.bash
....com/fsouza/go-dockerclient/travis-scripts/run-tests.bash
+15
-0
No files found.
Godeps/Godeps.json
View file @
903067c6
...
@@ -506,7 +506,7 @@
...
@@ -506,7 +506,7 @@
},
},
{
{
"ImportPath"
:
"github.com/fsouza/go-dockerclient"
,
"ImportPath"
:
"github.com/fsouza/go-dockerclient"
,
"Rev"
:
"
0099401a7342ad77e71ca9f9a57c5e72fb80f6b2
"
"Rev"
:
"
bf97c77db7c945cbcdbf09d56c6f87a66f54537b
"
},
},
{
{
"ImportPath"
:
"github.com/garyburd/redigo/internal"
,
"ImportPath"
:
"github.com/garyburd/redigo/internal"
,
...
...
Godeps/LICENSES
View file @
903067c6
...
@@ -18763,7 +18763,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...
@@ -18763,7 +18763,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
================================================================================
= Godeps/_workspace/src/github.com/fsouza/go-dockerclient licensed under: =
= Godeps/_workspace/src/github.com/fsouza/go-dockerclient licensed under: =
Copyright (c) 201
5
, go-dockerclient authors
Copyright (c) 201
6
, go-dockerclient authors
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml
View file @
903067c6
language
:
go
language
:
go
sudo
:
required
sudo
:
required
go
:
go
:
-
1.3.3
-
1.4.2
-
1.4.2
-
1.5.3
-
1.5.3
-
1.6
rc2
-
1.6
-
tip
-
tip
os
:
-
linux
-
osx
env
:
env
:
-
GOARCH=amd64 DOCKER_VERSION=1.7.1
-
GOARCH=386 DOCKER_VERSION=1.7.1
-
GOARCH=amd64 DOCKER_VERSION=1.8.3
-
GOARCH=amd64 DOCKER_VERSION=1.8.3
-
GOARCH=386 DOCKER_VERSION=1.8.3
-
GOARCH=386 DOCKER_VERSION=1.8.3
-
GOARCH=amd64 DOCKER_VERSION=1.9.1
-
GOARCH=amd64 DOCKER_VERSION=1.9.1
-
GOARCH=386 DOCKER_VERSION=1.9.1
-
GOARCH=386 DOCKER_VERSION=1.9.1
-
GOARCH=amd64 DOCKER_VERSION=1.10.
0
-
GOARCH=amd64 DOCKER_VERSION=1.10.
3
-
GOARCH=386 DOCKER_VERSION=1.10.
0
-
GOARCH=386 DOCKER_VERSION=1.10.
3
install
:
install
:
-
make prepare_docker
-
travis_retry travis-scripts/install.bash
script
:
script
:
-
make test
-
travis-scripts/run-tests.bash
-
DOCKER_HOST=tcp://127.0.0.1:2375 make integration
services
:
services
:
-
docker
-
docker
matrix
:
fast_finish
:
true
allow_failures
:
-
go
:
tip
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS
View file @
903067c6
...
@@ -14,6 +14,7 @@ Ben Marini <ben@remind101.com>
...
@@ -14,6 +14,7 @@ Ben Marini <ben@remind101.com>
Ben McCann <benmccann.com>
Ben McCann <benmccann.com>
Ben Parees <bparees@redhat.com>
Ben Parees <bparees@redhat.com>
Benno van den Berg <bennovandenberg@gmail.com>
Benno van den Berg <bennovandenberg@gmail.com>
Bradley Cicenas <bradley.cicenas@gmail.com>
Brendan Fosberry <brendan@codeship.com>
Brendan Fosberry <brendan@codeship.com>
Brian Lalor <blalor@bravo5.org>
Brian Lalor <blalor@bravo5.org>
Brian P. Hamachek <brian@brianhama.com>
Brian P. Hamachek <brian@brianhama.com>
...
@@ -48,6 +49,8 @@ Fabio Rehm <fgrehm@gmail.com>
...
@@ -48,6 +49,8 @@ Fabio Rehm <fgrehm@gmail.com>
Fatih Arslan <ftharsln@gmail.com>
Fatih Arslan <ftharsln@gmail.com>
Flavia Missi <flaviamissi@gmail.com>
Flavia Missi <flaviamissi@gmail.com>
Francisco Souza <f@souza.cc>
Francisco Souza <f@souza.cc>
Frank Groeneveld <frank@frankgroeneveld.nl>
George Moura <gwmoura@gmail.com>
Grégoire Delattre <gregoire.delattre@gmail.com>
Grégoire Delattre <gregoire.delattre@gmail.com>
Guillermo Álvarez Fernández <guillermo@cientifico.net>
Guillermo Álvarez Fernández <guillermo@cientifico.net>
Harry Zhang <harryzhang@zju.edu.cn>
Harry Zhang <harryzhang@zju.edu.cn>
...
@@ -84,7 +87,9 @@ Michael Schmatz <michaelschmatz@gmail.com>
...
@@ -84,7 +87,9 @@ Michael Schmatz <michaelschmatz@gmail.com>
Michal Fojtik <mfojtik@redhat.com>
Michal Fojtik <mfojtik@redhat.com>
Mike Dillon <mike.dillon@synctree.com>
Mike Dillon <mike.dillon@synctree.com>
Mrunal Patel <mrunalp@gmail.com>
Mrunal Patel <mrunalp@gmail.com>
Nate Jones <nate@endot.org>
Nguyen Sy Thanh Son <sonnst@sigma-solutions.eu>
Nguyen Sy Thanh Son <sonnst@sigma-solutions.eu>
Nicholas Van Wiggeren <nvanwiggeren@digitalocean.com>
Nick Ethier <ncethier@gmail.com>
Nick Ethier <ncethier@gmail.com>
Omeid Matten <public@omeid.me>
Omeid Matten <public@omeid.me>
Orivej Desh <orivej@gmx.fr>
Orivej Desh <orivej@gmx.fr>
...
@@ -98,9 +103,11 @@ Philippe Lafoucrière <philippe.lafoucriere@tech-angels.com>
...
@@ -98,9 +103,11 @@ Philippe Lafoucrière <philippe.lafoucriere@tech-angels.com>
Rafe Colton <rafael.colton@gmail.com>
Rafe Colton <rafael.colton@gmail.com>
Rob Miller <rob@kalistra.com>
Rob Miller <rob@kalistra.com>
Robert Williamson <williamson.robert@gmail.com>
Robert Williamson <williamson.robert@gmail.com>
Roman Khlystik <roman.khlystik@gmail.com>
Salvador Gironès <salvadorgirones@gmail.com>
Salvador Gironès <salvadorgirones@gmail.com>
Sam Rijs <srijs@airpost.net>
Sam Rijs <srijs@airpost.net>
Sami Wagiaalla <swagiaal@redhat.com>
Sami Wagiaalla <swagiaal@redhat.com>
Samuel Archambault <sarchambault@lapresse.ca>
Samuel Karp <skarp@amazon.com>
Samuel Karp <skarp@amazon.com>
Silas Sewell <silas@sewell.org>
Silas Sewell <silas@sewell.org>
Simon Eskildsen <sirup@sirupsen.com>
Simon Eskildsen <sirup@sirupsen.com>
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/LICENSE
View file @
903067c6
Copyright (c) 201
5
, go-dockerclient authors
Copyright (c) 201
6
, go-dockerclient authors
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile
View file @
903067c6
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
cov
\
cov
\
clean
clean
SRCS
=
$(
shell
git ls-files
'*.go'
|
grep
-v
'^external/'
)
PKGS
=
.
./testing
PKGS
=
./. ./testing
all
:
test
all
:
test
...
@@ -22,32 +21,30 @@ vendor:
...
@@ -22,32 +21,30 @@ vendor:
lint
:
lint
:
@
go get
-v
github.com/golang/lint/golint
@
go get
-v
github.com/golang/lint/golint
$
(
foreach file,
$(SRCS)
,golint
$(file)
||
exit
;
)
@
for
file
in
$$
(
git ls-files
'*.go'
|
grep
-v
'external/'
)
;
do
\
export
output
=
"
$$
(golint
$$
{file} | grep -v 'type name will be used as docker.DockerInfo')"
;
\
[
-n
"
$$
{output}"
]
&&
echo
"
$$
{output}"
&&
export
status
=
1
;
\
done
;
\
exit
$$
{
status:-0
}
vet
:
vet
:
@
-go
get
-v
golang.org/x/tools/cmd/vet
$
(
foreach pkg,
$(PKGS)
,go vet
$(pkg)
;
)
$
(
foreach pkg,
$(PKGS)
,go vet
$(pkg)
;
)
fmt
:
fmt
:
gofmt
-
w
$(SRC
S)
gofmt
-
s
-w
$(PKG
S)
fmtcheck
:
fmtcheck
:
$
(
foreach file,
$(SRCS)
,gofmt
-d
$(file)
;
)
@
export
output
=
$$
(
gofmt
-s
-d
$(PKGS)
)
;
\
[
-n
"
$$
{output}"
]
&&
echo
"
$$
{output}"
&&
export
status
=
1
;
\
prepare_docker
:
exit
$$
{
status:-0
}
sudo
stop docker
sudo rm
-rf
/var/lib/docker
sudo rm
-f
`
which docker
`
sudo
apt-key adv
--keyserver
hkp://p80.pool.sks-keyservers.net:80
--recv-keys
58118E89F3A912897C070ADBF76221572C52609D
echo
"deb https://apt.dockerproject.org/repo ubuntu-trusty main"
|
sudo tee
/etc/apt/sources.list.d/docker.list
sudo
apt-get update
sudo
apt-get
install
docker-engine
=
$(DOCKER_VERSION)
-0
~
$(
shell
lsb_release
-cs
)
-y
--force-yes
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
pretest
:
lint vet fmtcheck
pretest
:
lint vet fmtcheck
test
:
pretest
gotest
:
$
(
foreach pkg,
$(PKGS)
,go
test
$(pkg)
||
exit
;
)
$
(
foreach pkg,
$(PKGS)
,go
test
$(pkg)
||
exit
;
)
test
:
pretest gotest
integration
:
integration
:
go
test
-tags
docker_integration
-run
TestIntegration
-v
go
test
-tags
docker_integration
-run
TestIntegration
-v
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown
View file @
903067c6
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
[

](https://godoc.org/github.com/fsouza/go-dockerclient)
[

](https://godoc.org/github.com/fsouza/go-dockerclient)
This package presents a client for the Docker remote API. It also provides
This package presents a client for the Docker remote API. It also provides
support for the extensions in the
[
Swarm API
](
https://docs.docker.com/swarm/
api/
swarm-api/
)
.
support for the extensions in the
[
Swarm API
](
https://docs.docker.com/swarm/swarm-api/
)
.
This package also provides support for docker's network API, which is a simple
This package also provides support for docker's network API, which is a simple
passthrough to the libnetwork remote API. Note that docker's network API is
passthrough to the libnetwork remote API. Note that docker's network API is
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go
View file @
903067c6
...
@@ -82,10 +82,12 @@ func parseDockerConfig(r io.Reader) (map[string]dockerConfig, error) {
...
@@ -82,10 +82,12 @@ func parseDockerConfig(r io.Reader) (map[string]dockerConfig, error) {
buf
.
ReadFrom
(
r
)
buf
.
ReadFrom
(
r
)
byteData
:=
buf
.
Bytes
()
byteData
:=
buf
.
Bytes
()
var
confsWrapper
map
[
string
]
map
[
string
]
dockerConfig
confsWrapper
:=
struct
{
Auths
map
[
string
]
dockerConfig
`json:"auths"`
}{}
if
err
:=
json
.
Unmarshal
(
byteData
,
&
confsWrapper
);
err
==
nil
{
if
err
:=
json
.
Unmarshal
(
byteData
,
&
confsWrapper
);
err
==
nil
{
if
confs
,
ok
:=
confsWrapper
[
"auths"
];
ok
{
if
len
(
confsWrapper
.
Auths
)
>
0
{
return
confs
,
nil
return
confs
Wrapper
.
Auths
,
nil
}
}
}
}
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go
View file @
903067c6
...
@@ -555,6 +555,8 @@ type hijackOptions struct {
...
@@ -555,6 +555,8 @@ type hijackOptions struct {
data
interface
{}
data
interface
{}
}
}
// CloseWaiter is an interface with methods for closing the underlying resource
// and then waiting for it to finish processing.
type
CloseWaiter
interface
{
type
CloseWaiter
interface
{
io
.
Closer
io
.
Closer
Wait
()
error
Wait
()
error
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go
View file @
903067c6
This diff is collapsed.
Click to expand it.
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/event.go
View file @
903067c6
...
@@ -18,12 +18,38 @@ import (
...
@@ -18,12 +18,38 @@ import (
"time"
"time"
)
)
// APIEvents represents an event returned by the API.
// APIEvents represents events coming from the Docker API
// The fields in the Docker API changed in API version 1.22, and
// events for more than images and containers are now fired off.
// To maintain forward and backward compatibility, go-dockerclient
// replicates the event in both the new and old format as faithfully as possible.
//
// For events that only exist in 1.22 in later, `Status` is filled in as
// `"Type:Action"` instead of just `Action` to allow for older clients to
// differentiate and not break if they rely on the pre-1.22 Status types.
//
// The transformEvent method can be consulted for more information about how
// events are translated from new/old API formats
type
APIEvents
struct
{
type
APIEvents
struct
{
Status
string
`json:"Status,omitempty" yaml:"Status,omitempty"`
// New API Fields in 1.22
ID
string
`json:"ID,omitempty" yaml:"ID,omitempty"`
Action
string
`json:"action,omitempty"`
From
string
`json:"From,omitempty" yaml:"From,omitempty"`
Type
string
`json:"type,omitempty"`
Time
int64
`json:"Time,omitempty" yaml:"Time,omitempty"`
Actor
APIActor
`json:"actor,omitempty"`
// Old API fields for < 1.22
Status
string
`json:"status,omitempty"`
ID
string
`json:"id,omitempty"`
From
string
`json:"from,omitempty"`
// Fields in both
Time
int64
`json:"time,omitempty"`
TimeNano
int64
`json:"timeNano,omitempty"`
}
// APIActor represents an actor that accomplishes something for an event
type
APIActor
struct
{
ID
string
`json:"id,omitempty"`
Attributes
map
[
string
]
string
`json:"attributes,omitempty"`
}
}
type
eventMonitoringState
struct
{
type
eventMonitoringState
struct
{
...
@@ -52,6 +78,7 @@ var (
...
@@ -52,6 +78,7 @@ var (
// EOFEvent is sent when the event listener receives an EOF error.
// EOFEvent is sent when the event listener receives an EOF error.
EOFEvent
=
&
APIEvents
{
EOFEvent
=
&
APIEvents
{
Type
:
"EOF"
,
Status
:
"EOF"
,
Status
:
"EOF"
,
}
}
)
)
...
@@ -297,8 +324,47 @@ func (c *Client) eventHijack(startTime int64, eventChan chan *APIEvents, errChan
...
@@ -297,8 +324,47 @@ func (c *Client) eventHijack(startTime int64, eventChan chan *APIEvents, errChan
if
!
c
.
eventMonitor
.
isEnabled
()
{
if
!
c
.
eventMonitor
.
isEnabled
()
{
return
return
}
}
transformEvent
(
&
event
)
eventChan
<-
&
event
eventChan
<-
&
event
}
}
}(
res
,
conn
)
}(
res
,
conn
)
return
nil
return
nil
}
}
// transformEvent takes an event and determines what version it is from
// then populates both versions of the event
func
transformEvent
(
event
*
APIEvents
)
{
// if event version is <= 1.21 there will be no Action and no Type
if
event
.
Action
==
""
&&
event
.
Type
==
""
{
event
.
Action
=
event
.
Status
event
.
Actor
.
ID
=
event
.
ID
event
.
Actor
.
Attributes
=
map
[
string
]
string
{}
switch
event
.
Status
{
case
"delete"
,
"import"
,
"pull"
,
"push"
,
"tag"
,
"untag"
:
event
.
Type
=
"image"
default
:
event
.
Type
=
"container"
if
event
.
From
!=
""
{
event
.
Actor
.
Attributes
[
"image"
]
=
event
.
From
}
}
}
else
{
if
event
.
Status
==
""
{
if
event
.
Type
==
"image"
||
event
.
Type
==
"container"
{
event
.
Status
=
event
.
Action
}
else
{
// Because just the Status has been overloaded with different Types
// if an event is not for an image or a container, we prepend the type
// to avoid problems for people relying on actions being only for
// images and containers
event
.
Status
=
event
.
Type
+
":"
+
event
.
Action
}
}
if
event
.
ID
==
""
{
event
.
ID
=
event
.
Actor
.
ID
}
if
event
.
From
==
""
{
event
.
From
=
event
.
Actor
.
Attributes
[
"image"
]
}
}
}
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/chtimes_unix.go
0 → 100644
View file @
903067c6
// +build !windows
package
system
import
(
"time"
)
//setCTime will set the create time on a file. On Unix, the create
//time is updated as a side effect of setting the modified time, so
//no action is required.
func
setCTime
(
path
string
,
ctime
time
.
Time
)
error
{
return
nil
}
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/chtimes_windows.go
0 → 100644
View file @
903067c6
// +build windows
package
system
import
(
"syscall"
"time"
)
//setCTime will set the create time on a file. On Windows, this requires
//calling SetFileTime and explicitly including the create time.
func
setCTime
(
path
string
,
ctime
time
.
Time
)
error
{
ctimespec
:=
syscall
.
NsecToTimespec
(
ctime
.
UnixNano
())
pathp
,
e
:=
syscall
.
UTF16PtrFromString
(
path
)
if
e
!=
nil
{
return
e
}
h
,
e
:=
syscall
.
CreateFile
(
pathp
,
syscall
.
FILE_WRITE_ATTRIBUTES
,
syscall
.
FILE_SHARE_WRITE
,
nil
,
syscall
.
OPEN_EXISTING
,
syscall
.
FILE_FLAG_BACKUP_SEMANTICS
,
0
)
if
e
!=
nil
{
return
e
}
defer
syscall
.
Close
(
h
)
c
:=
syscall
.
NsecToFiletime
(
syscall
.
TimespecToNsec
(
ctimespec
))
return
syscall
.
SetFileTime
(
h
,
&
c
,
nil
,
nil
)
}
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_openbsd.go
0 → 100644
View file @
903067c6
package
system
import
(
"syscall"
)
// fromStatT creates a system.StatT type from a syscall.Stat_t type
func
fromStatT
(
s
*
syscall
.
Stat_t
)
(
*
StatT
,
error
)
{
return
&
StatT
{
size
:
s
.
Size
,
mode
:
uint32
(
s
.
Mode
),
uid
:
s
.
Uid
,
gid
:
s
.
Gid
,
rdev
:
uint64
(
s
.
Rdev
),
mtim
:
s
.
Mtim
},
nil
}
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_unsupported.go
View file @
903067c6
// +build !linux,!windows,!freebsd,!solaris
// +build !linux,!windows,!freebsd,!solaris
,!openbsd
package
system
package
system
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/golang.org/x/net/context/context.go
View file @
903067c6
...
@@ -210,13 +210,13 @@ type CancelFunc func()
...
@@ -210,13 +210,13 @@ type CancelFunc func()
// call cancel as soon as the operations running in this Context complete.
// call cancel as soon as the operations running in this Context complete.
func
WithCancel
(
parent
Context
)
(
ctx
Context
,
cancel
CancelFunc
)
{
func
WithCancel
(
parent
Context
)
(
ctx
Context
,
cancel
CancelFunc
)
{
c
:=
newCancelCtx
(
parent
)
c
:=
newCancelCtx
(
parent
)
propagateCancel
(
parent
,
&
c
)
propagateCancel
(
parent
,
c
)
return
&
c
,
func
()
{
c
.
cancel
(
true
,
Canceled
)
}
return
c
,
func
()
{
c
.
cancel
(
true
,
Canceled
)
}
}
}
// newCancelCtx returns an initialized cancelCtx.
// newCancelCtx returns an initialized cancelCtx.
func
newCancelCtx
(
parent
Context
)
cancelCtx
{
func
newCancelCtx
(
parent
Context
)
*
cancelCtx
{
return
cancelCtx
{
return
&
cancelCtx
{
Context
:
parent
,
Context
:
parent
,
done
:
make
(
chan
struct
{}),
done
:
make
(
chan
struct
{}),
}
}
...
@@ -259,7 +259,7 @@ func parentCancelCtx(parent Context) (*cancelCtx, bool) {
...
@@ -259,7 +259,7 @@ func parentCancelCtx(parent Context) (*cancelCtx, bool) {
case
*
cancelCtx
:
case
*
cancelCtx
:
return
c
,
true
return
c
,
true
case
*
timerCtx
:
case
*
timerCtx
:
return
&
c
.
cancelCtx
,
true
return
c
.
cancelCtx
,
true
case
*
valueCtx
:
case
*
valueCtx
:
parent
=
c
.
Context
parent
=
c
.
Context
default
:
default
:
...
@@ -377,7 +377,7 @@ func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
...
@@ -377,7 +377,7 @@ func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
// implement Done and Err. It implements cancel by stopping its timer then
// implement Done and Err. It implements cancel by stopping its timer then
// delegating to cancelCtx.cancel.
// delegating to cancelCtx.cancel.
type
timerCtx
struct
{
type
timerCtx
struct
{
cancelCtx
*
cancelCtx
timer
*
time
.
Timer
// Under cancelCtx.mu.
timer
*
time
.
Timer
// Under cancelCtx.mu.
deadline
time
.
Time
deadline
time
.
Time
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go
View file @
903067c6
...
@@ -32,6 +32,7 @@ type APIImages struct {
...
@@ -32,6 +32,7 @@ type APIImages struct {
// Image is the type representing a docker image and its various properties
// Image is the type representing a docker image and its various properties
type
Image
struct
{
type
Image
struct
{
ID
string
`json:"Id" yaml:"Id"`
ID
string
`json:"Id" yaml:"Id"`
RepoTags
[]
string
`json:"RepoTags,omitempty" yaml:"RepoTags,omitempty"`
Parent
string
`json:"Parent,omitempty" yaml:"Parent,omitempty"`
Parent
string
`json:"Parent,omitempty" yaml:"Parent,omitempty"`
Comment
string
`json:"Comment,omitempty" yaml:"Comment,omitempty"`
Comment
string
`json:"Comment,omitempty" yaml:"Comment,omitempty"`
Created
time
.
Time
`json:"Created,omitempty" yaml:"Created,omitempty"`
Created
time
.
Time
`json:"Created,omitempty" yaml:"Created,omitempty"`
...
@@ -421,6 +422,17 @@ type BuildImageOptions struct {
...
@@ -421,6 +422,17 @@ type BuildImageOptions struct {
AuthConfigs
AuthConfigurations
`qs:"-"`
// for newer docker X-Registry-Config header
AuthConfigs
AuthConfigurations
`qs:"-"`
// for newer docker X-Registry-Config header
ContextDir
string
`qs:"-"`
ContextDir
string
`qs:"-"`
Ulimits
[]
ULimit
`qs:"-"`
Ulimits
[]
ULimit
`qs:"-"`
BuildArgs
[]
BuildArg
`qs:"-"`
}
// BuildArg represents arguments that can be passed to the image when building
// it from a Dockerfile.
//
// For more details about the Docker building process, see
// http://goo.gl/tlPXPu.
type
BuildArg
struct
{
Name
string
`json:"Name,omitempty" yaml:"Name,omitempty"`
Value
string
`json:"Value,omitempty" yaml:"Value,omitempty"`
}
}
// BuildImage builds an image from a tarball's url or a Dockerfile in the input
// BuildImage builds an image from a tarball's url or a Dockerfile in the input
...
@@ -463,6 +475,18 @@ func (c *Client) BuildImage(opts BuildImageOptions) error {
...
@@ -463,6 +475,18 @@ func (c *Client) BuildImage(opts BuildImageOptions) error {
}
}
}
}
if
len
(
opts
.
BuildArgs
)
>
0
{
v
:=
make
(
map
[
string
]
string
)
for
_
,
arg
:=
range
opts
.
BuildArgs
{
v
[
arg
.
Name
]
=
arg
.
Value
}
if
b
,
err
:=
json
.
Marshal
(
v
);
err
==
nil
{
item
:=
url
.
Values
(
map
[
string
][]
string
{})
item
.
Add
(
"buildargs"
,
string
(
b
))
qs
=
fmt
.
Sprintf
(
"%s&%s"
,
qs
,
item
.
Encode
())
}
}
return
c
.
stream
(
"POST"
,
fmt
.
Sprintf
(
"/build?%s"
,
qs
),
streamOptions
{
return
c
.
stream
(
"POST"
,
fmt
.
Sprintf
(
"/build?%s"
,
qs
),
streamOptions
{
setRawTerminal
:
true
,
setRawTerminal
:
true
,
rawJSONStream
:
opts
.
RawJSONStream
,
rawJSONStream
:
opts
.
RawJSONStream
,
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/misc.go
View file @
903067c6
...
@@ -4,7 +4,10 @@
...
@@ -4,7 +4,10 @@
package
docker
package
docker
import
"strings"
import
(
"encoding/json"
"strings"
)
// Version returns version information about the docker server.
// Version returns version information about the docker server.
//
//
...
@@ -22,17 +25,81 @@ func (c *Client) Version() (*Env, error) {
...
@@ -22,17 +25,81 @@ func (c *Client) Version() (*Env, error) {
return
&
env
,
nil
return
&
env
,
nil
}
}
// DockerInfo contains information about the Docker server
//
// See https://goo.gl/bHUoz9 for more details.
type
DockerInfo
struct
{
ID
string
Containers
int
ContainersRunning
int
ContainersPaused
int
ContainersStopped
int
Images
int
Driver
string
DriverStatus
[][
2
]
string
SystemStatus
[][
2
]
string
Plugins
PluginsInfo
MemoryLimit
bool
SwapLimit
bool
KernelMemory
bool
CPUCfsPeriod
bool
`json:"CpuCfsPeriod"`
CPUCfsQuota
bool
`json:"CpuCfsQuota"`
CPUShares
bool
CPUSet
bool
IPv4Forwarding
bool
BridgeNfIptables
bool
BridgeNfIP6tables
bool
`json:"BridgeNfIp6tables"`
Debug
bool
NFd
int
OomKillDisable
bool
NGoroutines
int
SystemTime
string
ExecutionDriver
string
LoggingDriver
string
CgroupDriver
string
NEventsListener
int
KernelVersion
string
OperatingSystem
string
OSType
string
Architecture
string
IndexServerAddress
string
NCPU
int
MemTotal
int64
DockerRootDir
string
HTTPProxy
string
`json:"HttpProxy"`
HTTPSProxy
string
`json:"HttpsProxy"`
NoProxy
string
Name
string
Labels
[]
string
ExperimentalBuild
bool
ServerVersion
string
ClusterStore
string
ClusterAdvertise
string
}
// PluginsInfo is a struct with the plugins registered with the docker daemon
//
// for more information, see: https://goo.gl/bHUoz9
type
PluginsInfo
struct
{
// List of Volume plugins registered
Volume
[]
string
// List of Network plugins registered
Network
[]
string
// List of Authorization plugins registered
Authorization
[]
string
}
// Info returns system-wide information about the Docker server.
// Info returns system-wide information about the Docker server.
//
//
// See https://goo.gl/ElTHi2 for more details.
// See https://goo.gl/ElTHi2 for more details.
func
(
c
*
Client
)
Info
()
(
*
Env
,
error
)
{
func
(
c
*
Client
)
Info
()
(
*
DockerInfo
,
error
)
{
resp
,
err
:=
c
.
do
(
"GET"
,
"/info"
,
doOptions
{})
resp
,
err
:=
c
.
do
(
"GET"
,
"/info"
,
doOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
defer
resp
.
Body
.
Close
()
defer
resp
.
Body
.
Close
()
var
info
Env
var
info
DockerInfo
if
err
:=
info
.
Decode
(
resp
.
Body
);
err
!=
nil
{
if
err
:=
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
info
);
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
&
info
,
nil
return
&
info
,
nil
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go
View file @
903067c6
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
package
docker
package
docker
import
(
import
(
"bytes"
"encoding/json"
"encoding/json"
"errors"
"errors"
"fmt"
"fmt"
...
@@ -26,6 +27,7 @@ type Network struct {
...
@@ -26,6 +27,7 @@ type Network struct {
IPAM
IPAMOptions
IPAM
IPAMOptions
Containers
map
[
string
]
Endpoint
Containers
map
[
string
]
Endpoint
Options
map
[
string
]
string
Options
map
[
string
]
string
Internal
bool
}
}
// Endpoint contains network resources allocated and used for a container in a network
// Endpoint contains network resources allocated and used for a container in a network
...
@@ -55,6 +57,31 @@ func (c *Client) ListNetworks() ([]Network, error) {
...
@@ -55,6 +57,31 @@ func (c *Client) ListNetworks() ([]Network, error) {
return
networks
,
nil
return
networks
,
nil
}
}
// NetworkFilterOpts is an aggregation of key=value that Docker
// uses to filter networks
type
NetworkFilterOpts
map
[
string
]
map
[
string
]
bool
// FilteredListNetworks returns all networks with the filters applied
//
// See goo.gl/zd2mx4 for more details.
func
(
c
*
Client
)
FilteredListNetworks
(
opts
NetworkFilterOpts
)
([]
Network
,
error
)
{
params
:=
bytes
.
NewBuffer
(
nil
)
if
err
:=
json
.
NewEncoder
(
params
)
.
Encode
(
&
opts
);
err
!=
nil
{
return
nil
,
err
}
path
:=
"/networks?filters="
+
params
.
String
()
resp
,
err
:=
c
.
do
(
"GET"
,
path
,
doOptions
{})
if
err
!=
nil
{
return
nil
,
err
}
defer
resp
.
Body
.
Close
()
var
networks
[]
Network
if
err
:=
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
networks
);
err
!=
nil
{
return
nil
,
err
}
return
networks
,
nil
}
// NetworkInfo returns information about a network by its ID.
// NetworkInfo returns information about a network by its ID.
//
//
// See https://goo.gl/6GugX3 for more details.
// See https://goo.gl/6GugX3 for more details.
...
@@ -158,14 +185,40 @@ func (c *Client) RemoveNetwork(id string) error {
...
@@ -158,14 +185,40 @@ func (c *Client) RemoveNetwork(id string) error {
return
nil
return
nil
}
}
// NetworkConnectionOptions specify parameters to the ConnectNetwork and DisconnectNetwork function.
// NetworkConnectionOptions specify parameters to the ConnectNetwork and
// DisconnectNetwork function.
//
//
// See https://goo.gl/
6GugX3
for more details.
// See https://goo.gl/
RV7BJU
for more details.
type
NetworkConnectionOptions
struct
{
type
NetworkConnectionOptions
struct
{
Container
string
Container
string
// EndpointConfig is only applicable to the ConnectNetwork call
EndpointConfig
*
EndpointConfig
`json:"EndpointConfig,omitempty"`
// Force is only applicable to the DisconnectNetwork call
Force
bool
}
// EndpointConfig stores network endpoint details
//
// See https://goo.gl/RV7BJU for more details.
type
EndpointConfig
struct
{
IPAMConfig
*
EndpointIPAMConfig
Links
[]
string
Aliases
[]
string
}
// EndpointIPAMConfig represents IPAM configurations for an
// endpoint
//
// See https://goo.gl/RV7BJU for more details.
type
EndpointIPAMConfig
struct
{
IPv4Address
string
`json:",omitempty"`
IPv6Address
string
`json:",omitempty"`
}
}
// ConnectNetwork adds a container to a network or returns an error in case of failure.
// ConnectNetwork adds a container to a network or returns an error in case of
// failure.
//
//
// See https://goo.gl/6GugX3 for more details.
// See https://goo.gl/6GugX3 for more details.
func
(
c
*
Client
)
ConnectNetwork
(
id
string
,
opts
NetworkConnectionOptions
)
error
{
func
(
c
*
Client
)
ConnectNetwork
(
id
string
,
opts
NetworkConnectionOptions
)
error
{
...
@@ -180,7 +233,8 @@ func (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error
...
@@ -180,7 +233,8 @@ func (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error
return
nil
return
nil
}
}
// DisconnectNetwork removes a container from a network or returns an error in case of failure.
// DisconnectNetwork removes a container from a network or returns an error in
// case of failure.
//
//
// See https://goo.gl/6GugX3 for more details.
// See https://goo.gl/6GugX3 for more details.
func
(
c
*
Client
)
DisconnectNetwork
(
id
string
,
opts
NetworkConnectionOptions
)
error
{
func
(
c
*
Client
)
DisconnectNetwork
(
id
string
,
opts
NetworkConnectionOptions
)
error
{
...
@@ -204,7 +258,8 @@ func (err *NoSuchNetwork) Error() string {
...
@@ -204,7 +258,8 @@ func (err *NoSuchNetwork) Error() string {
return
fmt
.
Sprintf
(
"No such network: %s"
,
err
.
ID
)
return
fmt
.
Sprintf
(
"No such network: %s"
,
err
.
ID
)
}
}
// NoSuchNetwork is the error returned when a given network or container does not exist.
// NoSuchNetworkOrContainer is the error returned when a given network or
// container does not exist.
type
NoSuchNetworkOrContainer
struct
{
type
NoSuchNetworkOrContainer
struct
{
NetworkID
string
NetworkID
string
ContainerID
string
ContainerID
string
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go
View file @
903067c6
...
@@ -144,6 +144,7 @@ func (s *DockerServer) buildMuxer() {
...
@@ -144,6 +144,7 @@ func (s *DockerServer) buildMuxer() {
s
.
mux
.
Path
(
"/volumes/create"
)
.
Methods
(
"POST"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
createVolume
))
s
.
mux
.
Path
(
"/volumes/create"
)
.
Methods
(
"POST"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
createVolume
))
s
.
mux
.
Path
(
"/volumes/{name:.*}"
)
.
Methods
(
"GET"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
inspectVolume
))
s
.
mux
.
Path
(
"/volumes/{name:.*}"
)
.
Methods
(
"GET"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
inspectVolume
))
s
.
mux
.
Path
(
"/volumes/{name:.*}"
)
.
Methods
(
"DELETE"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
removeVolume
))
s
.
mux
.
Path
(
"/volumes/{name:.*}"
)
.
Methods
(
"DELETE"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
removeVolume
))
s
.
mux
.
Path
(
"/info"
)
.
Methods
(
"GET"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
infoDocker
))
}
}
// SetHook changes the hook function used by the server.
// SetHook changes the hook function used by the server.
...
@@ -743,10 +744,9 @@ func (s *DockerServer) commitContainer(w http.ResponseWriter, r *http.Request) {
...
@@ -743,10 +744,9 @@ func (s *DockerServer) commitContainer(w http.ResponseWriter, r *http.Request) {
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusNotFound
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusNotFound
)
return
return
}
}
var
config
*
docker
.
Config
config
:=
new
(
docker
.
Config
)
runConfig
:=
r
.
URL
.
Query
()
.
Get
(
"run"
)
runConfig
:=
r
.
URL
.
Query
()
.
Get
(
"run"
)
if
runConfig
!=
""
{
if
runConfig
!=
""
{
config
=
new
(
docker
.
Config
)
err
=
json
.
Unmarshal
([]
byte
(
runConfig
),
config
)
err
=
json
.
Unmarshal
([]
byte
(
runConfig
),
config
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
...
@@ -828,7 +828,8 @@ func (s *DockerServer) pullImage(w http.ResponseWriter, r *http.Request) {
...
@@ -828,7 +828,8 @@ func (s *DockerServer) pullImage(w http.ResponseWriter, r *http.Request) {
fromImageName
:=
r
.
URL
.
Query
()
.
Get
(
"fromImage"
)
fromImageName
:=
r
.
URL
.
Query
()
.
Get
(
"fromImage"
)
tag
:=
r
.
URL
.
Query
()
.
Get
(
"tag"
)
tag
:=
r
.
URL
.
Query
()
.
Get
(
"tag"
)
image
:=
docker
.
Image
{
image
:=
docker
.
Image
{
ID
:
s
.
generateID
(),
ID
:
s
.
generateID
(),
Config
:
&
docker
.
Config
{},
}
}
s
.
iMut
.
Lock
()
s
.
iMut
.
Lock
()
s
.
images
=
append
(
s
.
images
,
image
)
s
.
images
=
append
(
s
.
images
,
image
)
...
@@ -1244,3 +1245,86 @@ func (s *DockerServer) removeVolume(w http.ResponseWriter, r *http.Request) {
...
@@ -1244,3 +1245,86 @@ func (s *DockerServer) removeVolume(w http.ResponseWriter, r *http.Request) {
s
.
volStore
[
vol
.
volume
.
Name
]
=
nil
s
.
volStore
[
vol
.
volume
.
Name
]
=
nil
w
.
WriteHeader
(
http
.
StatusNoContent
)
w
.
WriteHeader
(
http
.
StatusNoContent
)
}
}
func
(
s
*
DockerServer
)
infoDocker
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
s
.
cMut
.
RLock
()
defer
s
.
cMut
.
RUnlock
()
s
.
iMut
.
RLock
()
defer
s
.
iMut
.
RUnlock
()
var
running
,
stopped
,
paused
int
for
_
,
c
:=
range
s
.
containers
{
if
c
.
State
.
Running
{
running
++
}
else
{
stopped
++
}
if
c
.
State
.
Paused
{
paused
++
}
}
envs
:=
map
[
string
]
interface
{}{
"ID"
:
"AAAA:XXXX:0000:BBBB:AAAA:XXXX:0000:BBBB:AAAA:XXXX:0000:BBBB"
,
"Containers"
:
len
(
s
.
containers
),
"ContainersRunning"
:
running
,
"ContainersPaused"
:
paused
,
"ContainersStopped"
:
stopped
,
"Images"
:
len
(
s
.
images
),
"Driver"
:
"aufs"
,
"DriverStatus"
:
[][]
string
{},
"SystemStatus"
:
nil
,
"Plugins"
:
map
[
string
]
interface
{}{
"Volume"
:
[]
string
{
"local"
,
},
"Network"
:
[]
string
{
"bridge"
,
"null"
,
"host"
,
},
"Authorization"
:
nil
,
},
"MemoryLimit"
:
true
,
"SwapLimit"
:
false
,
"CpuCfsPeriod"
:
true
,
"CpuCfsQuota"
:
true
,
"CPUShares"
:
true
,
"CPUSet"
:
true
,
"IPv4Forwarding"
:
true
,
"BridgeNfIptables"
:
true
,
"BridgeNfIp6tables"
:
true
,
"Debug"
:
false
,
"NFd"
:
79
,
"OomKillDisable"
:
true
,
"NGoroutines"
:
101
,
"SystemTime"
:
"2016-02-25T18:13:10.25870078Z"
,
"ExecutionDriver"
:
"native-0.2"
,
"LoggingDriver"
:
"json-file"
,
"NEventsListener"
:
0
,
"KernelVersion"
:
"3.13.0-77-generic"
,
"OperatingSystem"
:
"Ubuntu 14.04.3 LTS"
,
"OSType"
:
"linux"
,
"Architecture"
:
"x86_64"
,
"IndexServerAddress"
:
"https://index.docker.io/v1/"
,
"RegistryConfig"
:
map
[
string
]
interface
{}{
"InsecureRegistryCIDRs"
:
[]
string
{},
"IndexConfigs"
:
map
[
string
]
interface
{}{},
"Mirrors"
:
nil
,
},
"InitSha1"
:
"e2042dbb0fcf49bb9da199186d9a5063cda92a01"
,
"InitPath"
:
"/usr/lib/docker/dockerinit"
,
"NCPU"
:
1
,
"MemTotal"
:
2099204096
,
"DockerRootDir"
:
"/var/lib/docker"
,
"HttpProxy"
:
""
,
"HttpsProxy"
:
""
,
"NoProxy"
:
""
,
"Name"
:
"vagrant-ubuntu-trusty-64"
,
"Labels"
:
nil
,
"ExperimentalBuild"
:
false
,
"ServerVersion"
:
"1.10.1"
,
"ClusterStore"
:
""
,
"ClusterAdvertise"
:
""
,
}
w
.
WriteHeader
(
http
.
StatusOK
)
json
.
NewEncoder
(
w
)
.
Encode
(
envs
)
}
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/travis-scripts/install.bash
0 → 100644
View file @
903067c6
#!/bin/bash -x
# Copyright 2016 go-dockerclient authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
if
[[
$TRAVIS_OS_NAME
==
"linux"
]]
;
then
sudo
stop docker
||
true
sudo rm
-rf
/var/lib/docker
sudo rm
-f
`
which docker
`
set
-e
sudo
apt-key adv
--keyserver
hkp://p80.pool.sks-keyservers.net:80
--recv-keys
58118E89F3A912897C070ADBF76221572C52609D
echo
"deb https://apt.dockerproject.org/repo ubuntu-trusty main"
|
sudo tee
/etc/apt/sources.list.d/docker.list
sudo
apt-get update
sudo
apt-get
install
docker-engine
=
${
DOCKER_VERSION
}
-0
~
$(
lsb_release
-cs
)
-y
--force-yes
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
fi
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/travis-scripts/run-tests.bash
0 → 100644
View file @
903067c6
#!/bin/bash -ex
# Copyright 2016 go-dockerclient authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
if
!
[[
$TRAVIS_GO_VERSION
=
~ ^1
\.
[
34]
]]
;
then
make lint vet
fi
make fmtcheck gotest
if
[[
$TRAVIS_OS_NAME
==
"linux"
]]
;
then
DOCKER_HOST
=
tcp://127.0.0.1:2375 make integration
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment