Skip to content

Commit

Permalink
Start the disk manager watch files go-routine
Browse files Browse the repository at this point in the history
Signed-off-by: Sorin Dumitru <[email protected]>
  • Loading branch information
sorindumitru committed May 21, 2024
1 parent 5d5c33a commit 23e20a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/server/endpoints/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ type Config struct {
BundleManager *bundle_client.Manager
}

func (c *Config) maybeMakeBundleEndpointServer() Server {
func (c *Config) maybeMakeBundleEndpointServer(ctx context.Context) Server {
if c.BundleEndpoint.Address == nil {
return nil
}
Expand All @@ -109,6 +109,8 @@ func (c *Config) maybeMakeBundleEndpointServer() Server {
serverAuth = bundle.ACMEAuth(c.Log.WithField(telemetry.SubsystemName, "bundle_acme"), c.Catalog.GetKeyManager(), *c.BundleEndpoint.ACME)
} else if c.BundleEndpoint.DiskCertManager != nil {
serverAuth = c.BundleEndpoint.DiskCertManager
// Start watching for file changes
go c.BundleEndpoint.DiskCertManager.WatchFileChanges(ctx)
} else {
serverAuth = bundle.SPIFFEAuth(func() ([]*x509.Certificate, crypto.PrivateKey, error) {
state := c.SVIDObserver.State()
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/endpoints/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func New(ctx context.Context, c Config) (*Endpoints, error) {
DataStore: ds,
BundleCache: bundle.NewCache(ds, c.Clock),
APIServers: c.makeAPIServers(ef),
BundleEndpointServer: c.maybeMakeBundleEndpointServer(),
BundleEndpointServer: c.maybeMakeBundleEndpointServer(ctx),
Log: c.Log,
Metrics: c.Metrics,
RateLimit: c.RateLimit,
Expand Down

0 comments on commit 23e20a7

Please sign in to comment.