Add test ability to reinitialize worker auth roots on startup (#4895)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2024-06-17 12:26:55 -04:00
1 parent b54608b9f2
commit d547e0d459
3 files changed
+10 -1

No files matched your search

+1 -1
View File
@@ -475,7 +475,7 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
if err != nil {
return nil, fmt.Errorf("unable to instantiate worker auth repository: %w", err)
}
_, err = server.RotateRoots(ctx, serversRepo, nodeenrollment.WithCertificateLifetime(conf.TestOverrideWorkerAuthCaCertificateLifetime))
_, err = server.RotateRoots(ctx, serversRepo, nodeenrollment.WithCertificateLifetime(conf.TestOverrideWorkerAuthCaCertificateLifetime), nodeenrollment.WithReinitializeRoots(conf.TestWorkerAuthCaReinitialize))
if err != nil {
event.WriteSysEvent(ctx, op, "unable to ensure worker auth roots exist, may be due to multiple controllers starting at once, continuing")
}