Merge pull request #979 from cpuguy83/fix_ping_panic
Return early on ping error
This commit is contained in:
@@ -114,6 +114,7 @@ func (c *leaseController) sync(ctx context.Context) {
|
|||||||
pingResult, err := c.nodeController.nodePingController.getResult(ctx)
|
pingResult, err := c.nodeController.nodePingController.getResult(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.G(ctx).WithError(err).Error("Could not get ping status")
|
log.G(ctx).WithError(err).Error("Could not get ping status")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if pingResult.error != nil {
|
if pingResult.error != nil {
|
||||||
log.G(ctx).WithError(pingResult.error).Error("Ping result is not clean, not updating lease")
|
log.G(ctx).WithError(pingResult.error).Error("Ping result is not clean, not updating lease")
|
||||||
|
|||||||
@@ -134,7 +134,12 @@ func (p *syncProviderWrapper) syncPodStatuses(ctx context.Context) {
|
|||||||
|
|
||||||
for _, pod := range pods {
|
for _, pod := range pods {
|
||||||
if shouldSkipPodStatusUpdate(pod) {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user