Skip to content

Commit

Permalink
pass logger to kolide client
Browse files Browse the repository at this point in the history
  • Loading branch information
sechmann committed Jun 7, 2024
1 parent 26a681f commit d0581f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/apiserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func run(log *logrus.Entry, cfg config.Config) error {
return fmt.Errorf("kolide integration enabled but no kolide-api-token provided")
}

kolideClient = kolide.New(cfg.KolideApiToken)
kolideClient = kolide.New(cfg.KolideApiToken, log.WithField("component", "kolide-client"))
err := kolideClient.RefreshCache(ctx)
if err != nil {
return fmt.Errorf("initial kolide cache warmup: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion internal/apiserver/kolide/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ type client struct {
log logrus.FieldLogger
}

func New(token string) Client {
func New(token string, log logrus.FieldLogger) Client {
return &client{
baseUrl: "https://k2.kolide.com/api/v0",
client: &http.Client{
Transport: NewTransport(token),
},
checks: &Cache[uint64, Check]{},
devices: &Cache[string, Device]{},
log: log,
}
}

Expand Down

0 comments on commit d0581f0

Please sign in to comment.