mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 06:57:31 +00:00
health: prefix Warnables received from the control plane
Updates tailscale/corp#27759 Signed-off-by: James Sanderson <jsanderson@tailscale.com>
This commit is contained in:

committed by
James 'zofrex' Sanderson

parent
7b06532ea1
commit
5716d0977d
@@ -853,7 +853,7 @@ func (ms *mapSession) netmap() *netmap.NetworkMap {
|
||||
} else if len(ms.lastHealth) > 0 {
|
||||
// Convert all ms.lastHealth to the new [netmap.NetworkMap.DisplayMessages]
|
||||
for _, h := range ms.lastHealth {
|
||||
id := "control-health-" + strhash(h) // Unique ID in case there is more than one health message
|
||||
id := "health-" + strhash(h) // Unique ID in case there is more than one health message
|
||||
mak.Set(&msgs, tailcfg.DisplayMessageID(id), tailcfg.DisplayMessage{
|
||||
Title: "Coordination server reports an issue",
|
||||
Severity: tailcfg.SeverityMedium,
|
||||
|
@@ -1340,14 +1340,14 @@ func TestNetmapHealthIntegration(t *testing.T) {
|
||||
ht.SetControlHealth(nm.DisplayMessages)
|
||||
|
||||
want := map[health.WarnableCode]health.UnhealthyState{
|
||||
"control-health-c0719e9a8d5d838d861dc6f675c899d2b309a3a65bb9fe6b11e5afcbf9a2c0b1": {
|
||||
WarnableCode: "control-health-c0719e9a8d5d838d861dc6f675c899d2b309a3a65bb9fe6b11e5afcbf9a2c0b1",
|
||||
"control-health.health-c0719e9a8d5d838d861dc6f675c899d2b309a3a65bb9fe6b11e5afcbf9a2c0b1": {
|
||||
WarnableCode: "control-health.health-c0719e9a8d5d838d861dc6f675c899d2b309a3a65bb9fe6b11e5afcbf9a2c0b1",
|
||||
Title: "Coordination server reports an issue",
|
||||
Severity: health.SeverityMedium,
|
||||
Text: "The coordination server is reporting a health issue: Test message",
|
||||
},
|
||||
"control-health-1dc7017a73a3c55c0d6a8423e3813c7ab6562d9d3064c2ec6ac7822f61b1db9c": {
|
||||
WarnableCode: "control-health-1dc7017a73a3c55c0d6a8423e3813c7ab6562d9d3064c2ec6ac7822f61b1db9c",
|
||||
"control-health.health-1dc7017a73a3c55c0d6a8423e3813c7ab6562d9d3064c2ec6ac7822f61b1db9c": {
|
||||
WarnableCode: "control-health.health-1dc7017a73a3c55c0d6a8423e3813c7ab6562d9d3064c2ec6ac7822f61b1db9c",
|
||||
Title: "Coordination server reports an issue",
|
||||
Severity: health.SeverityMedium,
|
||||
Text: "The coordination server is reporting a health issue: Another message",
|
||||
@@ -1401,8 +1401,8 @@ func TestNetmapDisplayMessageIntegration(t *testing.T) {
|
||||
}
|
||||
|
||||
want := map[health.WarnableCode]health.UnhealthyState{
|
||||
"test-message": {
|
||||
WarnableCode: "test-message",
|
||||
"control-health.test-message": {
|
||||
WarnableCode: "control-health.test-message",
|
||||
Title: "Testing",
|
||||
Text: "This is a test message",
|
||||
Severity: health.SeverityHigh,
|
||||
|
Reference in New Issue
Block a user