health: remove SysDNSOS, add two Warnables for read+set system DNS config (#13874)

This commit is contained in:
Andrea Gottardo
2024-10-21 13:40:43 -07:00
committed by GitHub
parent 72587ab03c
commit f8f53bb6d4
3 changed files with 32 additions and 20 deletions

View File

@@ -163,9 +163,9 @@ func (m *resolvedManager) run(ctx context.Context) {
}
conn.Signal(signals)
// Reset backoff and SetNSOSHealth after successful on reconnect.
// Reset backoff and set osConfigurationSetWarnable to healthy after a successful reconnect.
bo.BackOff(ctx, nil)
m.health.SetDNSOSHealth(nil)
m.health.SetHealthy(osConfigurationSetWarnable)
return nil
}
@@ -243,9 +243,12 @@ func (m *resolvedManager) run(ctx context.Context) {
// Set health while holding the lock, because this will
// graciously serialize the resync's health outcome with a
// concurrent SetDNS call.
m.health.SetDNSOSHealth(err)
if err != nil {
m.logf("failed to configure systemd-resolved: %v", err)
m.health.SetUnhealthy(osConfigurationSetWarnable, health.Args{health.ArgError: err.Error()})
} else {
m.health.SetHealthy(osConfigurationSetWarnable)
}
}
}