health: add an ETag to UnhealthyState for change detection

Updates tailscale/corp#30596

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
This commit is contained in:
James Sanderson
2025-07-28 11:38:34 +01:00
committed by James 'zofrex' Sanderson
parent 5154bbb0b3
commit 5731869565
4 changed files with 215 additions and 7 deletions

View File

@@ -1361,7 +1361,7 @@ func TestNetmapHealthIntegration(t *testing.T) {
}
}
if d := cmp.Diff(want, got); d != "" {
if d := cmp.Diff(want, got, cmpopts.IgnoreFields(health.UnhealthyState{}, "ETag")); d != "" {
t.Fatalf("CurrentStatus().Warnings[\"control-health*\"] different than expected (-want +got)\n%s", d)
}
}
@@ -1414,7 +1414,7 @@ func TestNetmapDisplayMessageIntegration(t *testing.T) {
},
}
if diff := cmp.Diff(want, state.Warnings); diff != "" {
if diff := cmp.Diff(want, state.Warnings, cmpopts.IgnoreFields(health.UnhealthyState{}, "ETag")); diff != "" {
t.Errorf("unexpected message contents (-want +got):\n%s", diff)
}
}