vendor go-dockerclient

This commit is contained in:
Alex Dadgar 2016-06-21 11:11:48 -07:00
parent cf71cefc8e
commit adbf7332fc
5 changed files with 35 additions and 4 deletions

View File

@ -4,6 +4,7 @@ Abhishek Chanda <abhishek.becs@gmail.com>
Adam Bell-Hanssen <adamb@aller.no>
Adrien Kohlbecker <adrien.kohlbecker@gmail.com>
Aldrin Leal <aldrin@leal.eng.br>
Alex Dadgar <alex.dadgar@gmail.com>
Andreas Jaekle <andreas@jaekle.net>
Andrews Medina <andrewsmedina@gmail.com>
Andrey Sibiryov <kobolog@uber.com>
@ -73,6 +74,7 @@ Kamil Domanski <kamil@domanski.co>
Karan Misra <kidoman@gmail.com>
Ken Herner <chosenken@gmail.com>
Kim, Hirokuni <hirokuni.kim@kvh.co.jp>
Kostas Lekkas <kostas@lekkas.io>
Kyle Allan <kallan357@gmail.com>
Liron Levin <levinlir@gmail.com>
Lior Yankovich <lior@twistlock.com>
@ -108,6 +110,7 @@ Rob Miller <rob@kalistra.com>
Robbert Klarenbeek <robbertkl@renbeek.nl>
Robert Williamson <williamson.robert@gmail.com>
Roman Khlystik <roman.khlystik@gmail.com>
Russell Haering <russellhaering@gmail.com>
Salvador Gironès <salvadorgirones@gmail.com>
Sam Rijs <srijs@airpost.net>
Sami Wagiaalla <swagiaal@redhat.com>
@ -133,6 +136,7 @@ Victor Marmol <vmarmol@google.com>
Vincenzo Prignano <vincenzo.prignano@gmail.com>
Vlad Alexandru Ionescu <vlad.alexandru.ionescu@gmail.com>
Wiliam Souza <wiliamsouza83@gmail.com>
Xh4n3 <xyn1016@gmail.com>
Ye Yin <eyniy@qq.com>
Yu, Zou <zouyu7@huawei.com>
Yuriy Bogdanov <chinsay@gmail.com>

View File

@ -144,6 +144,9 @@ type Client struct {
serverAPIVersion APIVersion
expectedAPIVersion APIVersion
unixHTTPClient *http.Client
// A timeout to use when using both the unixHTTPClient and HTTPClient
timeout time.Duration
}
// NewClient returns a Client instance ready for communication with the given
@ -316,6 +319,12 @@ func NewVersionedTLSClientFromBytes(endpoint string, certPEMBlock, keyPEMBlock,
}, nil
}
// SetTimeout takes a timeout and applies it to subsequent requests to the
// docker engine
func (c *Client) SetTimeout(t time.Duration) {
c.timeout = t
}
func (c *Client) checkAPIVersion() error {
serverAPIVersionString, err := c.getServerAPIVersionString()
if err != nil {
@ -405,6 +414,12 @@ func (c *Client) do(method, path string, doOptions doOptions) (*http.Response, e
} else {
u = c.getURL(path)
}
// If the user has provided a timeout, apply it.
if c.timeout != 0 {
httpClient.Timeout = c.timeout
}
req, err := http.NewRequest(method, u, params)
if err != nil {
return nil, err

View File

@ -546,6 +546,8 @@ type KeyValuePair struct {
// - always: the docker daemon will always restart the container
// - on-failure: the docker daemon will restart the container on failures, at
// most MaximumRetryCount times
// - unless-stopped: the docker daemon will always restart the container except
// when user has manually stopped the container
// - no: the docker daemon will not restart the container automatically
type RestartPolicy struct {
Name string `json:"Name,omitempty" yaml:"Name,omitempty"`
@ -564,6 +566,12 @@ func RestartOnFailure(maxRetry int) RestartPolicy {
return RestartPolicy{Name: "on-failure", MaximumRetryCount: maxRetry}
}
// RestartUnlessStopped returns a restart policy that tells the Docker daemon to
// always restart the container except when user has manually stopped the container.
func RestartUnlessStopped() RestartPolicy {
return RestartPolicy{Name: "unless-stopped"}
}
// NeverRestart returns a restart policy that tells the Docker daemon to never
// restart the container on failures.
func NeverRestart() RestartPolicy {
@ -627,6 +635,7 @@ type HostConfig struct {
CgroupParent string `json:"CgroupParent,omitempty" yaml:"CgroupParent,omitempty"`
Memory int64 `json:"Memory,omitempty" yaml:"Memory,omitempty"`
MemoryReservation int64 `json:"MemoryReservation,omitempty" yaml:"MemoryReservation,omitempty"`
KernelMemory int64 `json:"KernelMemory,omitempty" yaml:"KernelMemory,omitempty"`
MemorySwap int64 `json:"MemorySwap,omitempty" yaml:"MemorySwap,omitempty"`
MemorySwappiness int64 `json:"MemorySwappiness,omitempty" yaml:"MemorySwappiness,omitempty"`
OOMKillDisable bool `json:"OomKillDisable,omitempty" yaml:"OomKillDisable"`
@ -647,6 +656,7 @@ type HostConfig struct {
OomScoreAdj int `json:"OomScoreAdj,omitempty" yaml:"OomScoreAdj,omitempty"`
PidsLimit int64 `json:"PidsLimit,omitempty" yaml:"PidsLimit,omitempty"`
ShmSize int64 `json:"ShmSize,omitempty" yaml:"ShmSize,omitempty"`
Tmpfs map[string]string `json:"Tmpfs,omitempty" yaml:"Tmpfs,omitempty"`
}
// NetworkingConfig represents the container's networking configuration for each of its interfaces

View File

@ -53,10 +53,12 @@ type APIActor struct {
}
type eventMonitoringState struct {
// `sync/atomic` expects the first word in an allocated struct to be 64-bit
// aligned on both ARM and x86-32. See https://goo.gl/zW7dgq for more details.
lastSeen int64
sync.RWMutex
sync.WaitGroup
enabled bool
lastSeen int64
C chan *APIEvents
errC chan error
listeners []chan<- *APIEvents

6
vendor/vendor.json vendored
View File

@ -277,10 +277,10 @@
"revision": "8929fe90cee4b2cb9deb468b51fb34eba64d1bf0"
},
{
"checksumSHA1": "knZvr8o60olCcXYO2p/VizzSbNU=",
"checksumSHA1": "QhCS39gtKwqQb13GY4NnKOObZzY=",
"path": "github.com/fsouza/go-dockerclient",
"revision": "d9a325f6111a14ebceefba8ff6afeb3bdaa72729",
"revisionTime": "2016-05-19T23:43:40Z"
"revision": "8fd726ff652fdc430907f7ba90187458f0617221",
"revisionTime": "2016-06-21T18:02:18Z"
},
{
"path": "github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus",