mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
fix short circuit if the compaction request from apiserver is disabled
This commit is contained in:
parent
60c4c2b252
commit
9fef30117f
@ -378,6 +378,10 @@ func startCompactorOnce(c storagebackend.TransportConfig, interval time.Duration
|
||||
compactorsMu.Lock()
|
||||
defer compactorsMu.Unlock()
|
||||
|
||||
if interval == 0 {
|
||||
// short circuit, if the compaction request from apiserver is disabled
|
||||
return func() {}, nil
|
||||
}
|
||||
key := fmt.Sprintf("%v", c) // gives: {[server1 server2] keyFile certFile caFile}
|
||||
if compactor, foundBefore := compactors[key]; !foundBefore || compactor.interval > interval {
|
||||
compactorClient, err := newETCD3Client(c)
|
||||
|
Loading…
Reference in New Issue
Block a user