diff --git a/probe/tag/docker_tagger.go b/probe/tag/docker_tagger.go index e4b9b34e97..14e49adbd5 100644 --- a/probe/tag/docker_tagger.go +++ b/probe/tag/docker_tagger.go @@ -240,6 +240,19 @@ func (t *DockerTagger) updatePIDTree() error { return nil } +// Containers returns the Containers the DockerTagger knows about. +func (t *DockerTagger) Containers() []*docker.Container { + containers := []*docker.Container{} + + t.RLock() + for _, container := range t.containers { + containers = append(containers, container) + } + t.RUnlock() + + return containers +} + // Tag implements Tagger. func (t *DockerTagger) Tag(r report.Report) report.Report { for nodeID, nodeMetadata := range r.Process.NodeMetadatas {