Lot 47 : journal du sous-agent indépendant du poste

Le briefing machine des vues des rôles nomme l'hôte et le compte : masqués
dans le journal ({{HOTE}}, {{COMPTE}}), qui différait sur le poste de la CI.
Il nomme aussi le système et l'architecture : journal tiré sous Linux
seulement, comme les autres journaux qui dépendent du poste.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016tcGfJWefW5kUGoC2wL8cv
This commit is contained in:
Claude committed 2026-10-16 07:15:53 +00:00
1 parent ded1c97c17
commit e8563d992c
2 files changed
+13 -3

No files matched your search

+10
View File
@@ -1,3 +1,5 @@
//go:build linux
package loki
import (
@@ -9,6 +11,7 @@ import (
"net/http/httptest"
"net/url"
"os"
"os/user"
"path/filepath"
"strings"
"sync"
@@ -195,6 +198,13 @@ func TestPariteSubagent(t *testing.T) {
if h := os.Getenv("LOKI_HOME"); h != "" {
got = bytes.ReplaceAll(got, []byte(h), []byte("{{HOME}}"))
}
// Le briefing machine nomme l'hôte et le compte : propres au poste.
if host, _ := os.Hostname(); host != "" {
got = bytes.ReplaceAll(got, []byte("host="+host+","), []byte("host={{HOTE}},"))
}
if u, err := user.Current(); err == nil && u.Username != "" {
got = bytes.ReplaceAll(got, []byte(", user="+u.Username+","), []byte(", user={{COMPTE}},"))
}
if os.Getenv("LOKI_PARITY_UPDATE") == "1" {
if err := os.MkdirAll(filepath.Dir(paritySubagentFile), 0o755); err != nil {
t.Fatal(err)