set container IPs to host IPs for containers with --net=host

This commit is contained in:
Paul Bellamy
2016-02-17 16:42:52 +00:00
parent 092342c0ff
commit df856d78dc
2 changed files with 57 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ const (
ContainerState = "docker_container_state"
ContainerUptime = "docker_container_uptime"
ContainerRestartCount = "docker_container_restart_count"
ContainerNetworkMode = "docker_container_network_mode"
NetworkRxDropped = "network_rx_dropped"
NetworkRxBytes = "network_rx_bytes"
@@ -58,6 +59,8 @@ const (
StateStopped = "stopped"
StatePaused = "paused"
NetworkModeHost = "host"
stopTimeout = 10
)
@@ -355,6 +358,7 @@ func (c *container) GetNode(hostID string, localAddrs []net.IP) report.Node {
result = result.WithLatests(map[string]string{
ContainerUptime: uptime.String(),
ContainerRestartCount: strconv.Itoa(c.container.RestartCount),
ContainerNetworkMode: c.container.HostConfig.NetworkMode,
})
result = result.WithControls(
RestartContainer, StopContainer, PauseContainer, AttachContainer, ExecContainer,