Skip to content

Commit 9fef301

Browse files
committed
fix short circuit if the compaction request from apiserver is disabled
1 parent 60c4c2b commit 9fef301

File tree

1 file changed

+4
-0
lines changed
  • staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory

1 file changed

+4
-0
lines changed

staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ func startCompactorOnce(c storagebackend.TransportConfig, interval time.Duration
378378
compactorsMu.Lock()
379379
defer compactorsMu.Unlock()
380380

381+
if interval == 0 {
382+
// short circuit, if the compaction request from apiserver is disabled
383+
return func() {}, nil
384+
}
381385
key := fmt.Sprintf("%v", c) // gives: {[server1 server2] keyFile certFile caFile}
382386
if compactor, foundBefore := compactors[key]; !foundBefore || compactor.interval > interval {
383387
compactorClient, err := newETCD3Client(c)

0 commit comments

Comments
 (0)