Skip to content

Commit

Permalink
connectivity: collect sysdump from all clusters on failure
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
giorio94 authored and tklauser committed Mar 13, 2024
1 parent dbd3594 commit bca8c63
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions connectivity/check/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit bca8c63

Please sign in to comment.