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