Skip to content

Commit

Permalink
fix: partial docker syncTargets
Browse files Browse the repository at this point in the history
syncTargets for docker is called within a loop which leads to an incomplete targets slice to be sent to the manager.

Moving the syncTargets after the loop ensures that always all targets are correctly registered.
  • Loading branch information
FerdinandvHagen authored Nov 17, 2023
1 parent 950870a commit f97f35b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions component/loki/source/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ func (c *Component) Update(args component.Arguments) error {
return err
}
targets = append(targets, tgt)

// This will never fail because it only fails if the context gets canceled.
_ = c.manager.syncTargets(context.Background(), targets)
}

// This will never fail because it only fails if the context gets canceled.
_ = c.manager.syncTargets(context.Background(), targets)

c.args = newArgs
return nil
}
Expand Down

0 comments on commit f97f35b

Please sign in to comment.