fix(scheduler): same fieldAt i<=0 bug as haproxy_stats.go safeAt

fieldAt() in the scheduler used i<=0 instead of i<0, causing pxname
(column 0 in HAProxy CSV) to always return "". The HasPrefix("",
"eg_backend_") check then filtered every row → byBackend was always
empty → backend.down alert never fired since the check was introduced.
v1.1.115.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-27 13:31:56 +02:00
parent 7c86656c36
commit 1c60affd27
4 changed files with 5 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ import (
"git.netcell-it.de/projekte/edgeguard-native/internal/services/tlscerts"
)
var version = "1.1.114"
var version = "1.1.115"
const (
// renewTickInterval — how often we re-evaluate expiring certs.
@@ -769,7 +769,7 @@ func runBackendDownCheck(ctx context.Context, pool *pgxpool.Pool, a *alerts.Serv
}
func fieldAt(fields []string, i int) string {
if i <= 0 || i >= len(fields) {
if i < 0 || i >= len(fields) {
return ""
}
return fields[i]