From 82d0c289ba0a07d48060d35b0dc99caddafc8e78 Mon Sep 17 00:00:00 2001 From: Andrea Panattoni Date: Thu, 15 Feb 2024 18:31:06 +0100 Subject: [PATCH] e2e: Dump multus namespace on failures Cluster info gathered at the end of the test run might not contain all the needed information, as nodes might have been reboot and logs are gone. The `k8sreporter` runs as a Gomega Failure Handler and can help debugging the flaking test: ``` [sriov] operator Generic SriovNetworkNodePolicy CNI Logging level [It] Debug logging should be visible in multus pod ``` Signed-off-by: Andrea Panattoni --- test/util/k8sreporter/reporter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/util/k8sreporter/reporter.go b/test/util/k8sreporter/reporter.go index 5b89ae748..5a3405a91 100644 --- a/test/util/k8sreporter/reporter.go +++ b/test/util/k8sreporter/reporter.go @@ -26,6 +26,8 @@ func New(reportPath string) (*kniK8sReporter.KubernetesReporter, error) { operatorNamespace = "openshift-sriov-network-operator" } + multusNamespace := os.Getenv("MULTUS_NAMESPACE") + dumpNamespace := func(ns string) bool { switch { case ns == namespaces.Test: @@ -34,6 +36,8 @@ func New(reportPath string) (*kniK8sReporter.KubernetesReporter, error) { return true case strings.HasPrefix(ns, "sriov-"): return true + case multusNamespace != "" && ns == multusNamespace: + return true } return false }