Skip to content

Commit ae678af

Browse files
committed
Don't evict manually-loaded certs
1 parent 476582b commit ae678af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func (certCache *Cache) unsyncedCacheCertificate(cert Certificate) {
247247
rnd := weakrand.Intn(cacheSize)
248248
i := 0
249249
for _, randomCert := range certCache.cache {
250-
if i == rnd {
250+
if i >= rnd && randomCert.managed { // don't evict manually-loaded certs
251251
certCache.logger.Debug("cache full; evicting random certificate",
252252
zap.Strings("removing_subjects", randomCert.Names),
253253
zap.String("removing_hash", randomCert.hash),

0 commit comments

Comments
 (0)