Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 57674db

Browse files
author
Yifan Gu
committed
checkpoint: Fix garbage collection bug.
The apiParentPods is always non-nil, so we should test the length instead of the nil pointer. Besides, testing the length will work for nil pointer as well.
1 parent 91b66bd commit 57674db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/checkpoint/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func process(localRunningPods, localParentPods, apiParentPods, activeCheckpoints
217217
// We can only make some GC decisions if we've successfully contacted an apiserver.
218218
// When apiParentPods == nil, that means we were not able to get an updated list of pods.
219219
removeMap := make(map[string]struct{})
220-
if apiParentPods != nil {
220+
if len(apiParentPods) != 0 {
221221

222222
// Scan for inacive checkpoints we should GC
223223
for id := range inactiveCheckpoints {

0 commit comments

Comments
 (0)