Add support for docker healthcheck

- React to health_status events
- Filter container that have a health status *and* that are not healthy

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-10-03 11:01:37 +02:00
parent 408ef0f5b7
commit d68389dc52
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3
2 changed files with 28 additions and 0 deletions

View file

@ -569,12 +569,18 @@ func TestDockerGetLabel(t *testing.T) {
}{
{
container: docker.ContainerJSON{
ContainerJSONBase: &docker.ContainerJSONBase{
Name: "foo",
},
Config: &container.Config{},
},
expected: "Label not found:",
},
{
container: docker.ContainerJSON{
ContainerJSONBase: &docker.ContainerJSONBase{
Name: "foo",
},
Config: &container.Config{
Labels: map[string]string{
"foo": "bar",
@ -608,6 +614,9 @@ func TestDockerGetLabels(t *testing.T) {
}{
{
container: docker.ContainerJSON{
ContainerJSONBase: &docker.ContainerJSONBase{
Name: "foo",
},
Config: &container.Config{},
},
expectedLabels: map[string]string{},
@ -615,6 +624,9 @@ func TestDockerGetLabels(t *testing.T) {
},
{
container: docker.ContainerJSON{
ContainerJSONBase: &docker.ContainerJSONBase{
Name: "foo",
},
Config: &container.Config{
Labels: map[string]string{
"foo": "fooz",
@ -628,6 +640,9 @@ func TestDockerGetLabels(t *testing.T) {
},
{
container: docker.ContainerJSON{
ContainerJSONBase: &docker.ContainerJSONBase{
Name: "foo",
},
Config: &container.Config{
Labels: map[string]string{
"foo": "fooz",