mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-16 19:59:56 +02:00
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:
2 files changed
+13
-3
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user