From aa195ed1807e1c5a9ec238997c884be73fef1cfe Mon Sep 17 00:00:00 2001 From: Marco Iorio Date: Tue, 12 Mar 2024 10:05:18 +0100 Subject: [PATCH] connectivity: collect sysdump from all clusters on failure Collect a sysdump from both clusters on failures when the connectivity suite is run in multi cluster mode, and the --collect-sysdump-on-failure is set, so that it is easier to troubleshoot possible failures. Signed-off-by: Marco Iorio --- connectivity/check/test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/connectivity/check/test.go b/connectivity/check/test.go index cb3dd44a2b..ff825810a3 100644 --- a/connectivity/check/test.go +++ b/connectivity/check/test.go @@ -878,14 +878,16 @@ func (t *Test) EgressGatewayNode() string { } func (t *Test) collectSysdump() { - collector, err := sysdump.NewCollector(t.ctx.K8sClient(), t.ctx.params.SysdumpOptions, time.Now(), t.ctx.version) - if err != nil { - t.Failf("Failed to create sysdump collector: %v", err) - return - } + for _, client := range t.ctx.Clients() { + collector, err := sysdump.NewCollector(client, t.ctx.params.SysdumpOptions, time.Now(), t.ctx.version) + if err != nil { + t.Failf("Failed to create sysdump collector: %v", err) + return + } - if err = collector.Run(); err != nil { - t.Failf("Failed to collect sysdump: %v", err) + if err = collector.Run(); err != nil { + t.Failf("Failed to collect sysdump: %v", err) + } } }