Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/auth/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,12 @@ func NewTestAuthServer(cfg TestAuthServerConfig) (*TestAuthServer, error) {

if cfg.CacheEnabled {
srv.AuthServer.Cache, err = accesspoint.NewAccessCache(accesspoint.AccessCacheConfig{
Context: ctx,
Context: srv.AuthServer.CloseContext(),
Services: srv.AuthServer.Services,
Setup: cache.ForAuth,
CacheName: []string{teleport.ComponentAuth},
Events: true,
Unstarted: true,
})
if err != nil {
return nil, trace.Wrap(err)
Expand Down Expand Up @@ -436,6 +437,13 @@ func NewTestAuthServer(cfg TestAuthServerConfig) (*TestAuthServer, error) {
return nil, trace.Wrap(err)
}

// Auth initialization is done (including creation/updating of all singleton
// configuration resources) so now we can start the cache.
if c, ok := srv.AuthServer.Cache.(*cache.Cache); ok {
if err := c.Start(); err != nil {
Comment thread
GavinFrazar marked this conversation as resolved.
return nil, trace.NewAggregate(err, c.Close())
}
}
return srv, nil
}

Expand Down