Skip to content

Commit

Permalink
Output a single docker name (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
raboof committed Jan 23, 2017
1 parent f670b6a commit 2923dd8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions beater/connbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Connbeat struct {

type ContainerInfo struct {
id string
names []string
name string
image string
localIPs mapset.Set
environment []string
Expand Down Expand Up @@ -111,7 +111,7 @@ func toMap(containerInfo *ContainerInfo) common.MapStr {
if containerInfo != nil {
return common.MapStr{
"id": containerInfo.id,
"names": containerInfo.names,
"name": containerInfo.name,
"image": containerInfo.image,
"local_ips": containerInfo.localIPs.ToSlice(),
"env": containerInfo.environment,
Expand Down Expand Up @@ -178,7 +178,7 @@ func update(infos map[string]ContainerInfo, socketContainerInfo *sockets.Contain
localIPs := mapset.NewSet()
info = ContainerInfo{
socketContainerInfo.ID,
socketContainerInfo.Names,
socketContainerInfo.Name,
socketContainerInfo.Image,
localIPs, socketContainerInfo.DockerEnvironment,
socketContainerInfo.Ports,
Expand Down
2 changes: 1 addition & 1 deletion sockets/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (p *Poller) getContainerInfo(container docker.APIContainers) (*sockets.Cont
environment := p.getEnvironment(inspected)
return &sockets.ContainerInfo{
ID: container.ID,
Names: container.Names,
Name: inspected.Name,
Image: container.Image,
DockerEnvironment: environment,
Ports: inspected.NetworkSettings.Ports,
Expand Down
2 changes: 1 addition & 1 deletion sockets/sockets.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type ContainerInfo struct {
ID string
Names []string
Name string
Image string
DockerEnvironment []string
Ports map[docker.Port][]docker.PortBinding
Expand Down

0 comments on commit 2923dd8

Please sign in to comment.