Skip to content

Commit

Permalink
k8s: Add container Ids to container report
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Acosta committed Feb 18, 2016
1 parent 1e3014c commit bf3ecd7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions probe/kubernetes/reporter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package kubernetes

import (
"github.com/weaveworks/scope/probe/docker"
"github.com/weaveworks/scope/report"

"k8s.io/kubernetes/pkg/labels"
)

This comment has been minimized.

Copy link
@tomwilkie

tomwilkie Feb 18, 2016

Contributor

please sort import groups in the order [stdlib, thirdparty, this project]


Expand Down Expand Up @@ -66,11 +68,12 @@ func (r *Reporter) podTopology(services []Service) (report.Topology, report.Topo
nodeID := report.MakePodNodeID(p.Namespace(), p.Name())
pods = pods.AddNode(nodeID, p.GetNode())

container := report.MakeNodeWith(map[string]string{
PodID: p.ID(),
Namespace: p.Namespace(),
}).WithParents(report.EmptySets.Add(report.Pod, report.MakeStringSet(nodeID)))
for _, containerID := range p.ContainerIDs() {
container := report.MakeNodeWith(map[string]string{
PodID: p.ID(),
Namespace: p.Namespace(),
docker.ContainerID: containerID,
}).WithParents(report.EmptySets.Add(report.Pod, report.MakeStringSet(nodeID)))
containers.AddNode(report.MakeContainerNodeID(containerID), container)
}
return nil
Expand Down

0 comments on commit bf3ecd7

Please sign in to comment.