mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Don't tag processes with stopped container ids.
This commit is contained in:
@@ -84,6 +84,7 @@ type Container interface {
|
||||
PID() int
|
||||
Hostname() string
|
||||
GetNode(string, []net.IP) report.Node
|
||||
State() string
|
||||
|
||||
StartGatheringStats() error
|
||||
StopGatheringStats()
|
||||
@@ -131,6 +132,15 @@ func (c *container) Hostname() string {
|
||||
c.container.Config.Domainname)
|
||||
}
|
||||
|
||||
func (c *container) State() string {
|
||||
if c.container.State.Paused {
|
||||
return StatePaused
|
||||
} else if c.container.State.Running {
|
||||
return StateRunning
|
||||
}
|
||||
return StateStopped
|
||||
}
|
||||
|
||||
func (c *container) StartGatheringStats() error {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
@@ -297,14 +307,7 @@ func (c *container) GetNode(hostID string, localAddrs []net.IP) report.Node {
|
||||
ipsWithScopes = append(ipsWithScopes, report.MakeScopedAddressNodeID(hostID, ip))
|
||||
}
|
||||
|
||||
var state string
|
||||
if c.container.State.Paused {
|
||||
state = StatePaused
|
||||
} else if c.container.State.Running {
|
||||
state = StateRunning
|
||||
} else {
|
||||
state = StateStopped
|
||||
}
|
||||
state := c.State()
|
||||
|
||||
result := report.MakeNodeWith(map[string]string{
|
||||
ContainerID: c.ID(),
|
||||
|
||||
@@ -78,7 +78,7 @@ func (t *Tagger) tag(tree process.Tree, topology *report.Topology) {
|
||||
}
|
||||
})
|
||||
|
||||
if c == nil {
|
||||
if c == nil || c.State() == StateStopped || c.PID() == 1 {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user