Fix leader election logging
PR added support for leader election on endpoints for
controllers, but the legacy (etcd) mode was logging NotFound errors,
which would be a normal condition when endpoints were not configured.
This change ensures that logging only occurs for errors other than
NotFound.
@@ -133,7 +133,10 @@ func legacyLeaderElectionStart(id, name string, leased *plug.Leased, lock rl.Int
leased.Stop(nil)
return true, nil
}
+ // NotFound indicates the endpoint is missing and the etcd lease should continue to be held
+ if !kapierrors.IsNotFound(err) {
utilruntime.HandleError(fmt.Errorf("unable to confirm %s lease exists: %v", name, err))
+ }
return false, nil
})
}
