From ce309148e519ed3de3d7c99552dcb3dcf7523ee0 Mon Sep 17 00:00:00 2001 From: Kyle Squizzato Date: Tue, 10 Sep 2024 07:51:54 -0700 Subject: [PATCH] Prepend hostname to collected logs Signed-off-by: Kyle Squizzato --- test/e2e/e2e_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index dbebcf96e..450828a9d 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -245,7 +245,7 @@ func collectLogArtifacts(kc *kubeclient.KubeClient, clusterName string, provider } defer podLogs.Close() //nolint:errcheck - output, err := os.Create(fmt.Sprintf("./test/e2e/%s.log", kc.Config.Username+"-"+pod.Name)) + output, err := os.Create(fmt.Sprintf("./test/e2e/%s.log", kc.Config.Host+"-"+pod.Name)) if err != nil { utils.WarnError(fmt.Errorf("failed to create log file for pod %s: %w", pod.Name, err)) continue @@ -268,7 +268,7 @@ func collectLogArtifacts(kc *kubeclient.KubeClient, clusterName string, provider return } - err = os.WriteFile(filepath.Join("test/e2e", kc.Config.Username+"-"+"clusterctl.log"), output, 0644) + err = os.WriteFile(filepath.Join("test/e2e", kc.Config.Host+"-"+"clusterctl.log"), output, 0644) if err != nil { utils.WarnError(fmt.Errorf("failed to write clusterctl log: %w", err)) }