Fix crash in Docker input plugin - Fixes #1195
Commit fixes crash in Docker input plugin caused by the fact that return value might be nil when error occurs. closes #1195
This commit is contained in:
committed by
Cameron Sparr
parent
08ecfb8a67
commit
39df2635bd
@@ -221,7 +221,7 @@ func (d *Docker) gatherContainer(
|
||||
defer cancel()
|
||||
r, err := d.client.ContainerStats(ctx, container.ID, false)
|
||||
if err != nil {
|
||||
log.Printf("Error getting docker stats: %s\n", err.Error())
|
||||
return fmt.Errorf("Error getting docker stats: %s", err.Error())
|
||||
}
|
||||
defer r.Close()
|
||||
dec := json.NewDecoder(r)
|
||||
|
||||
Reference in New Issue
Block a user