Merge pull request #979 from cpuguy83/fix_ping_panic

Return early on ping error
This commit is contained in:
Brian Goff
2021-09-03 12:02:55 -07:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -114,6 +114,7 @@ func (c *leaseController) sync(ctx context.Context) {
pingResult, err := c.nodeController.nodePingController.getResult(ctx)
if err != nil {
log.G(ctx).WithError(err).Error("Could not get ping status")
return
}
if pingResult.error != nil {
log.G(ctx).WithError(pingResult.error).Error("Ping result is not clean, not updating lease")

View File

@@ -134,7 +134,12 @@ func (p *syncProviderWrapper) syncPodStatuses(ctx context.Context) {
for _, pod := range pods {
if shouldSkipPodStatusUpdate(pod) {
log.G(ctx).Debug("Skipping pod status update")
log.G(ctx).WithFields(log.Fields{
"pod": pod.Name,
"namespace": pod.Namespace,
"phase": pod.Status.Phase,
"status": pod.Status.Reason,
}).Debug("Skipping pod status update")
continue
}