Skip to content

Commit

Permalink
Avoid remote status requests with 0 pods
Browse files Browse the repository at this point in the history
  • Loading branch information
dciangot authored Jul 3, 2024
1 parent 513456c commit 1e4cc24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/virtualkubelet/virtualkubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ func (p *VirtualKubeletProvider) statusLoop(ctx context.Context) {
}
}

if podsList != nil {
if len(podsList) > 0 {
_, err = checkPodsStatus(ctx, p, podsList, string(b), p.config)
if err != nil {
log.G(ctx).Error(err)
Expand All @@ -718,6 +718,8 @@ func (p *VirtualKubeletProvider) statusLoop(ctx context.Context) {
}
p.pods[key] = pod
}
} else {
log.G(ctx).Info("No pods to monitor, waiting for the next loop to start")
}

log.G(ctx).Info("statusLoop=end")
Expand Down

0 comments on commit 1e4cc24

Please sign in to comment.