mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-24 02:25:24 +00:00
Add more logging
This commit is contained in:
parent
ecb7dfad15
commit
5322373fa1
@ -223,6 +223,10 @@ func (h *Headscale) handlePrimarySubnetFailover() error {
|
|||||||
if !route.IsPrimary {
|
if !route.IsPrimary {
|
||||||
_, err := h.getPrimaryRoute(netip.Prefix(route.Prefix))
|
_, err := h.getPrimaryRoute(netip.Prefix(route.Prefix))
|
||||||
if h.isUniquePrefix(route) || errors.Is(err, gorm.ErrRecordNotFound) {
|
if h.isUniquePrefix(route) || errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
log.Info().
|
||||||
|
Str("prefix", netip.Prefix(route.Prefix).String()).
|
||||||
|
Str("machine", route.Machine.GivenName).
|
||||||
|
Msg("Setting primary route")
|
||||||
routes[pos].IsPrimary = true
|
routes[pos].IsPrimary = true
|
||||||
err := h.db.Save(&routes[pos]).Error
|
err := h.db.Save(&routes[pos]).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user