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
1eff1d52
Commit
1eff1d52
authored
Feb 05, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20033 from bparees/dockerclient_bump
Auto commit by PR queue bot
parents
58e09b41
45a4b4c3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
16 deletions
+41
-16
Godeps.json
Godeps/Godeps.json
+2
-2
.travis.yml
...rkspace/src/github.com/fsouza/go-dockerclient/.travis.yml
+2
-2
AUTHORS
.../_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS
+2
-0
image.go
..._workspace/src/github.com/fsouza/go-dockerclient/image.go
+2
-0
network.go
...orkspace/src/github.com/fsouza/go-dockerclient/network.go
+11
-10
server.go
...e/src/github.com/fsouza/go-dockerclient/testing/server.go
+22
-2
No files found.
Godeps/Godeps.json
View file @
1eff1d52
...
...
@@ -425,8 +425,8 @@
},
{
"ImportPath"
:
"github.com/fsouza/go-dockerclient"
,
"Comment"
:
"0.2.1-
728-g1399676
"
,
"Rev"
:
"2
99d728486342c894e7fafd68e3a4b89623bef1d
"
"Comment"
:
"0.2.1-
860-g25bc220
"
,
"Rev"
:
"2
5bc220b299845ae5489fd19bf89c5278864b050
"
},
{
"ImportPath"
:
"github.com/garyburd/redigo/internal"
,
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml
View file @
1eff1d52
...
...
@@ -3,8 +3,8 @@ sudo: required
go
:
-
1.3.3
-
1.4.2
-
1.5.
2
-
1.6beta
1
-
1.5.
3
-
1.6beta
2
-
tip
env
:
-
GOARCH=amd64 DOCKER_VERSION=1.7.1
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS
View file @
1eff1d52
...
...
@@ -12,6 +12,7 @@ Antonio Murdaca <runcom@redhat.com>
Artem Sidorenko <artem@2realities.com>
Ben Marini <ben@remind101.com>
Ben McCann <benmccann.com>
Ben Parees <bparees@redhat.com>
Benno van den Berg <bennovandenberg@gmail.com>
Brendan Fosberry <brendan@codeship.com>
Brian Lalor <blalor@bravo5.org>
...
...
@@ -37,6 +38,7 @@ Dave Choi <dave.choi@daumkakao.com>
David Huie <dahuie@gmail.com>
Dawn Chen <dawnchen@google.com>
Dinesh Subhraveti <dinesh@gemini-systems.net>
Drew Wells <drew.wells00@gmail.com>
Ed <edrocksit@gmail.com>
Elias G. Schneevoigt <eliasgs@gmail.com>
Erez Horev <erez.horev@elastifile.com>
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go
View file @
1eff1d52
...
...
@@ -410,6 +410,8 @@ type BuildImageOptions struct {
Memory
int64
`qs:"memory"`
Memswap
int64
`qs:"memswap"`
CPUShares
int64
`qs:"cpushares"`
CPUQuota
int64
`qs:"cpuquota"`
CPUPeriod
int64
`qs:"cpuperiod"`
CPUSetCPUs
string
`qs:"cpusetcpus"`
InputStream
io
.
Reader
`qs:"-"`
OutputStream
io
.
Writer
`qs:"-"`
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go
View file @
1eff1d52
...
...
@@ -17,19 +17,20 @@ var ErrNetworkAlreadyExists = errors.New("network already exists")
// Network represents a network.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
type
Network
struct
{
Name
string
ID
string
`json:"Id"`
Scope
string
Driver
string
IPAM
IPAMOptions
Containers
map
[
string
]
Endpoint
Options
map
[
string
]
string
}
// Endpoint contains network resources allocated and used for a container in a network
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
type
Endpoint
struct
{
Name
string
ID
string
`json:"EndpointID"`
...
...
@@ -40,7 +41,7 @@ type Endpoint struct {
// ListNetworks returns all networks.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
func
(
c
*
Client
)
ListNetworks
()
([]
Network
,
error
)
{
resp
,
err
:=
c
.
do
(
"GET"
,
"/networks"
,
doOptions
{})
if
err
!=
nil
{
...
...
@@ -56,7 +57,7 @@ func (c *Client) ListNetworks() ([]Network, error) {
// NetworkInfo returns information about a network by its ID.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
func
(
c
*
Client
)
NetworkInfo
(
id
string
)
(
*
Network
,
error
)
{
path
:=
"/networks/"
+
id
resp
,
err
:=
c
.
do
(
"GET"
,
path
,
doOptions
{})
...
...
@@ -77,7 +78,7 @@ func (c *Client) NetworkInfo(id string) (*Network, error) {
// CreateNetworkOptions specify parameters to the CreateNetwork function and
// (for now) is the expected body of the "create network" http request message
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
type
CreateNetworkOptions
struct
{
Name
string
`json:"Name"`
CheckDuplicate
bool
`json:"CheckDuplicate"`
...
...
@@ -107,7 +108,7 @@ type IPAMConfig struct {
// CreateNetwork creates a new network, returning the network instance,
// or an error in case of failure.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
func
(
c
*
Client
)
CreateNetwork
(
opts
CreateNetworkOptions
)
(
*
Network
,
error
)
{
resp
,
err
:=
c
.
do
(
"POST"
,
...
...
@@ -144,7 +145,7 @@ func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) {
// RemoveNetwork removes a network or returns an error in case of failure.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
func
(
c
*
Client
)
RemoveNetwork
(
id
string
)
error
{
resp
,
err
:=
c
.
do
(
"DELETE"
,
"/networks/"
+
id
,
doOptions
{})
if
err
!=
nil
{
...
...
@@ -159,14 +160,14 @@ func (c *Client) RemoveNetwork(id string) error {
// NetworkConnectionOptions specify parameters to the ConnectNetwork and DisconnectNetwork function.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
type
NetworkConnectionOptions
struct
{
Container
string
}
// ConnectNetwork adds a container to a network or returns an error in case of failure.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
func
(
c
*
Client
)
ConnectNetwork
(
id
string
,
opts
NetworkConnectionOptions
)
error
{
resp
,
err
:=
c
.
do
(
"POST"
,
"/networks/"
+
id
+
"/connect"
,
doOptions
{
data
:
opts
})
if
err
!=
nil
{
...
...
@@ -181,7 +182,7 @@ func (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error
// DisconnectNetwork removes a container from a network or returns an error in case of failure.
//
// See https://goo.gl/
1kmPKZ
for more details.
// See https://goo.gl/
6GugX3
for more details.
func
(
c
*
Client
)
DisconnectNetwork
(
id
string
,
opts
NetworkConnectionOptions
)
error
{
resp
,
err
:=
c
.
do
(
"POST"
,
"/networks/"
+
id
+
"/disconnect"
,
doOptions
{
data
:
opts
})
if
err
!=
nil
{
...
...
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go
View file @
1eff1d52
...
...
@@ -38,6 +38,7 @@ var nameRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]+$`)
// For more details on the remote API, check http://goo.gl/G3plxW.
type
DockerServer
struct
{
containers
[]
*
docker
.
Container
uploadedFiles
map
[
string
]
string
execs
[]
*
docker
.
ExecInspect
execMut
sync
.
RWMutex
cMut
sync
.
RWMutex
...
...
@@ -89,6 +90,7 @@ func NewServer(bind string, containerChan chan<- *docker.Container, hook func(*h
execCallbacks
:
make
(
map
[
string
]
func
()),
statsCallbacks
:
make
(
map
[
string
]
func
(
string
)
docker
.
Stats
),
customHandlers
:
make
(
map
[
string
]
http
.
Handler
),
uploadedFiles
:
make
(
map
[
string
]
string
),
cChan
:
containerChan
,
}
server
.
buildMuxer
()
...
...
@@ -120,6 +122,7 @@ func (s *DockerServer) buildMuxer() {
s
.
mux
.
Path
(
"/containers/{id:.*}"
)
.
Methods
(
"DELETE"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
removeContainer
))
s
.
mux
.
Path
(
"/containers/{id:.*}/exec"
)
.
Methods
(
"POST"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
createExecContainer
))
s
.
mux
.
Path
(
"/containers/{id:.*}/stats"
)
.
Methods
(
"GET"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
statsContainer
))
s
.
mux
.
Path
(
"/containers/{id:.*}/archive"
)
.
Methods
(
"PUT"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
uploadToContainer
))
s
.
mux
.
Path
(
"/exec/{id:.*}/resize"
)
.
Methods
(
"POST"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
resizeExecContainer
))
s
.
mux
.
Path
(
"/exec/{id:.*}/start"
)
.
Methods
(
"POST"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
startExecContainer
))
s
.
mux
.
Path
(
"/exec/{id:.*}/json"
)
.
Methods
(
"GET"
)
.
HandlerFunc
(
s
.
handlerWrapper
(
s
.
inspectExecContainer
))
...
...
@@ -440,8 +443,8 @@ func (s *DockerServer) createContainer(w http.ResponseWriter, r *http.Request) {
s
.
cMut
.
Unlock
()
w
.
WriteHeader
(
http
.
StatusCreated
)
s
.
notify
(
&
container
)
var
c
=
struct
{
ID
string
}{
ID
:
container
.
ID
}
json
.
NewEncoder
(
w
)
.
Encode
(
c
)
json
.
NewEncoder
(
w
)
.
Encode
(
c
ontainer
)
}
func
(
s
*
DockerServer
)
generateID
()
string
{
...
...
@@ -503,6 +506,23 @@ func (s *DockerServer) statsContainer(w http.ResponseWriter, r *http.Request) {
}
}
func
(
s
*
DockerServer
)
uploadToContainer
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
id
:=
mux
.
Vars
(
r
)[
"id"
]
container
,
_
,
err
:=
s
.
findContainer
(
id
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusNotFound
)
return
}
if
!
container
.
State
.
Running
{
w
.
WriteHeader
(
http
.
StatusInternalServerError
)
fmt
.
Fprintf
(
w
,
"Container %s is not running"
,
id
)
return
}
path
:=
r
.
URL
.
Query
()
.
Get
(
"path"
)
s
.
uploadedFiles
[
id
]
=
path
w
.
WriteHeader
(
http
.
StatusOK
)
}
func
(
s
*
DockerServer
)
topContainer
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
id
:=
mux
.
Vars
(
r
)[
"id"
]
container
,
_
,
err
:=
s
.
findContainer
(
id
)
...
...
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