Skip to content

Commit d0581f0

Browse files
committed
pass logger to kolide client
1 parent 26a681f commit d0581f0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/apiserver/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func run(log *logrus.Entry, cfg config.Config) error {
200200
return fmt.Errorf("kolide integration enabled but no kolide-api-token provided")
201201
}
202202

203-
kolideClient = kolide.New(cfg.KolideApiToken)
203+
kolideClient = kolide.New(cfg.KolideApiToken, log.WithField("component", "kolide-client"))
204204
err := kolideClient.RefreshCache(ctx)
205205
if err != nil {
206206
return fmt.Errorf("initial kolide cache warmup: %w", err)

internal/apiserver/kolide/client.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ type client struct {
2626
log logrus.FieldLogger
2727
}
2828

29-
func New(token string) Client {
29+
func New(token string, log logrus.FieldLogger) Client {
3030
return &client{
3131
baseUrl: "https://k2.kolide.com/api/v0",
3232
client: &http.Client{
3333
Transport: NewTransport(token),
3434
},
3535
checks: &Cache[uint64, Check]{},
3636
devices: &Cache[string, Device]{},
37+
log: log,
3738
}
3839
}
3940

0 commit comments

Comments
 (0)