Skip to content

Commit

Permalink
Check if error via ListKeys of Storage Interface. (#1015)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>

Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya authored Sep 22, 2022
1 parent db7ea27 commit e4eb566
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/yurthub/gc/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ func (m *GCManager) Run() {

func (m *GCManager) gcPodsWhenRestart() {
localPodKeys, err := m.store.ListKeys("kubelet/pods")
if err != nil || len(localPodKeys) == 0 {
if err != nil {
klog.Errorf("failed to list keys for kubelet pods, %v", err)
return
} else if len(localPodKeys) == 0 {
klog.Infof("local storage for kubelet pods is empty, not need to gc pods")
return
}
Expand Down

0 comments on commit e4eb566

Please sign in to comment.