mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
set container IPs to host IPs for containers with --net=host
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user