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.
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")
|
||||||
|
|||||||
Reference in New Issue
Block a user