diff --git a/test/e2e/install_test.go b/test/e2e/install_test.go index a4d57d109..262d8da33 100644 --- a/test/e2e/install_test.go +++ b/test/e2e/install_test.go @@ -380,9 +380,18 @@ func getArtifactsOutput(ctx context.Context, basePath string) { GinkgoWriter.Printf("Failed to list pods %w in namespace: %q", err, namespace.Name) } for _, pod := range pods.Items { + // Save pod to artifact path + podYaml, err := yaml.Marshal(pod) + if err != nil { + GinkgoWriter.Printf("Failed to marshal deployment %w", err) + continue + } if pod.Status.Phase != corev1.PodRunning && pod.Status.Phase != corev1.PodSucceeded && pod.Status.Phase != corev1.PodFailed { continue } + if err := os.WriteFile(filepath.Join(namespacedArtifactPath, pod.Name+"-pod.yaml"), podYaml, 0600); err != nil { + GinkgoWriter.Printf("Failed to write pod to file %w", err) + } for _, container := range pod.Spec.Containers { logs, err := kubeClient.CoreV1().Pods(namespace.Name).GetLogs(pod.Name, &corev1.PodLogOptions{Container: container.Name}).Stream(ctx) if err != nil {