From 09ad3fe64447996c04e990ca7de122a1795f7f81 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Tue, 24 Aug 2021 18:49:42 +0000 Subject: [PATCH 1/2] Return early on ping error Found that this caused a panic after many many test runs. It seems like we should have returned early since the pingResult is nil. We don't want to update a lease when ping fails. --- node/lease_controller_v1.go | 1 + 1 file changed, 1 insertion(+) diff --git a/node/lease_controller_v1.go b/node/lease_controller_v1.go index aba55910f..3d57e8b27 100644 --- a/node/lease_controller_v1.go +++ b/node/lease_controller_v1.go @@ -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") From 22f329fcf0250c5d14931169bf76dca0c0c3f6d1 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 3 Sep 2021 18:02:35 +0000 Subject: [PATCH 2/2] Add extra logging for pod status update skip --- node/sync.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node/sync.go b/node/sync.go index 62d7ebbfe..2a0a158f5 100644 --- a/node/sync.go +++ b/node/sync.go @@ -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 }