Merge pull request #124524 from jbtk/env-vars

Append both env variables instead of fetching twice and overriding them.
This commit is contained in:
Kubernetes Prow Robot
2024-04-25 12:16:30 -07:00
committed by GitHub

View File

@@ -615,8 +615,10 @@ func CoreDump(dir string) {
Logf("Dumping logs locally to: %s", dir)
cmd = exec.Command(path.Join(TestContext.RepoRoot, "cluster", "log-dump", "log-dump.sh"), dir)
}
cmd.Env = append(os.Environ(), fmt.Sprintf("LOG_DUMP_SYSTEMD_SERVICES=%s", parseSystemdServices(TestContext.SystemdServices)))
cmd.Env = append(os.Environ(), fmt.Sprintf("LOG_DUMP_SYSTEMD_JOURNAL=%v", TestContext.DumpSystemdJournal))
env := os.Environ()
env = append(env, fmt.Sprintf("LOG_DUMP_SYSTEMD_SERVICES=%s", parseSystemdServices(TestContext.SystemdServices)))
env = append(env, fmt.Sprintf("LOG_DUMP_SYSTEMD_JOURNAL=%v", TestContext.DumpSystemdJournal))
cmd.Env = env
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr