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:
Brian Goff
2021-08-24 18:49:42 +00:00
parent 68347d4ed1
commit 09ad3fe644

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")