mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-13 14:41:42 +00:00
Support collecting log for alternative container runtime in e2e test.
This commit is contained in:
@@ -4517,6 +4517,7 @@ 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("SYSTEMD_SERVICES=%s", parseSystemdServices(TestContext.SystemdServices)))
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
@@ -4524,6 +4525,11 @@ func CoreDump(dir string) {
|
||||
}
|
||||
}
|
||||
|
||||
// parseSystemdServices converts services separator from comma to space.
|
||||
func parseSystemdServices(services string) string {
|
||||
return strings.TrimSpace(strings.Replace(services, ",", " ", -1))
|
||||
}
|
||||
|
||||
func UpdatePodWithRetries(client clientset.Interface, ns, name string, update func(*v1.Pod)) (*v1.Pod, error) {
|
||||
for i := 0; i < 3; i++ {
|
||||
pod, err := client.CoreV1().Pods(ns).Get(name, metav1.GetOptions{})
|
||||
|
||||
Reference in New Issue
Block a user