1
0
mirror of https://github.com/juanfont/headscale.git synced 2024-12-20 19:09:07 +01:00

Merge pull request #312 from hdhoang/patch-1

This commit is contained in:
Kristoffer Dalby 2022-02-12 12:27:57 +00:00 committed by GitHub
commit c794f32f58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -12,6 +12,7 @@
- `ip_prefix` is now superseded by `ip_prefixes` in the configuration [#208](https://github.com/juanfont/headscale/pull/208) - `ip_prefix` is now superseded by `ip_prefixes` in the configuration [#208](https://github.com/juanfont/headscale/pull/208)
- Upgrade `tailscale` (1.20.4) and other dependencies to latest [#314](https://github.com/juanfont/headscale/pull/314) - Upgrade `tailscale` (1.20.4) and other dependencies to latest [#314](https://github.com/juanfont/headscale/pull/314)
- fix swapped machine<->namespace labels in `/metrics` [#312](https://github.com/juanfont/headscale/pull/312)
**0.12.4 (2022-01-29):** **0.12.4 (2022-01-29):**

12
poll.go
View File

@ -193,7 +193,7 @@ func (h *Headscale) PollNetMapHandler(ctx *gin.Context) {
// It sounds like we should update the nodes when we have received a endpoint update // It sounds like we should update the nodes when we have received a endpoint update
// even tho the comments in the tailscale code dont explicitly say so. // even tho the comments in the tailscale code dont explicitly say so.
updateRequestsFromNode.WithLabelValues(machine.Name, machine.Namespace.Name, "endpoint-update"). updateRequestsFromNode.WithLabelValues(machine.Namespace.Name, machine.Name, "endpoint-update").
Inc() Inc()
updateChan <- struct{}{} updateChan <- struct{}{}
@ -222,7 +222,7 @@ func (h *Headscale) PollNetMapHandler(ctx *gin.Context) {
Str("handler", "PollNetMap"). Str("handler", "PollNetMap").
Str("machine", machine.Name). Str("machine", machine.Name).
Msg("Notifying peers") Msg("Notifying peers")
updateRequestsFromNode.WithLabelValues(machine.Name, machine.Namespace.Name, "full-update"). updateRequestsFromNode.WithLabelValues(machine.Namespace.Name, machine.Name, "full-update").
Inc() Inc()
updateChan <- struct{}{} updateChan <- struct{}{}
@ -413,7 +413,7 @@ func (h *Headscale) PollNetMapStream(
Str("machine", machine.Name). Str("machine", machine.Name).
Str("channel", "update"). Str("channel", "update").
Msg("Received a request for update") Msg("Received a request for update")
updateRequestsReceivedOnChannel.WithLabelValues(machine.Name, machine.Namespace.Name). updateRequestsReceivedOnChannel.WithLabelValues(machine.Namespace.Name, machine.Name).
Inc() Inc()
if h.isOutdated(machine) { if h.isOutdated(machine) {
var lastUpdate time.Time var lastUpdate time.Time
@ -443,7 +443,7 @@ func (h *Headscale) PollNetMapStream(
Str("channel", "update"). Str("channel", "update").
Err(err). Err(err).
Msg("Could not write the map response") Msg("Could not write the map response")
updateRequestsSentToNode.WithLabelValues(machine.Name, machine.Namespace.Name, "failed"). updateRequestsSentToNode.WithLabelValues(machine.Namespace.Name, machine.Name, "failed").
Inc() Inc()
return false return false
@ -453,7 +453,7 @@ func (h *Headscale) PollNetMapStream(
Str("machine", machine.Name). Str("machine", machine.Name).
Str("channel", "update"). Str("channel", "update").
Msg("Updated Map has been sent") Msg("Updated Map has been sent")
updateRequestsSentToNode.WithLabelValues(machine.Name, machine.Namespace.Name, "success"). updateRequestsSentToNode.WithLabelValues(machine.Namespace.Name, machine.Name, "success").
Inc() Inc()
// Keep track of the last successful update, // Keep track of the last successful update,
@ -582,7 +582,7 @@ func (h *Headscale) scheduledPollWorker(
Str("func", "scheduledPollWorker"). Str("func", "scheduledPollWorker").
Str("machine", machine.Name). Str("machine", machine.Name).
Msg("Sending update request") Msg("Sending update request")
updateRequestsFromNode.WithLabelValues(machine.Name, machine.Namespace.Name, "scheduled-update"). updateRequestsFromNode.WithLabelValues(machine.Namespace.Name, machine.Name, "scheduled-update").
Inc() Inc()
updateChan <- struct{}{} updateChan <- struct{}{}
} }