Fix Swarm panic

This commit is contained in:
Emile Vauge 2016-11-28 16:46:37 +01:00
parent 055cd01bb7
commit 841be8d806
No known key found for this signature in database
GPG key ID: D808B4C167352E59

View file

@ -560,6 +560,10 @@ func parseContainer(container dockertypes.ContainerJSON) dockerData {
if container.ContainerJSONBase.HostConfig != nil {
dockerData.NetworkSettings.NetworkMode = container.ContainerJSONBase.HostConfig.NetworkMode
}
if container.State != nil && container.State.Health != nil {
dockerData.Health = container.State.Health.Status
}
}
if container.Config != nil && container.Config.Labels != nil {
@ -583,10 +587,6 @@ func parseContainer(container dockertypes.ContainerJSON) dockerData {
}
if container.State != nil && container.State.Health != nil {
dockerData.Health = container.State.Health.Status
}
return dockerData
}