From 83fcd351d73e114d737f8ba76a78a835bcd49460 Mon Sep 17 00:00:00 2001 From: James Flather Date: Thu, 25 Jul 2024 22:18:25 +0100 Subject: [PATCH] rpk: Add uname -a to debug bundle (cherry picked from commit 785a76d14496f1e5b6c10f3b5160f6b6c673f961) --- src/go/rpk/pkg/cli/debug/bundle/bundle_k8s_linux.go | 1 + src/go/rpk/pkg/cli/debug/bundle/bundle_linux.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/go/rpk/pkg/cli/debug/bundle/bundle_k8s_linux.go b/src/go/rpk/pkg/cli/debug/bundle/bundle_k8s_linux.go index 7a8aca8134e2e..e9e17b7d49f1b 100644 --- a/src/go/rpk/pkg/cli/debug/bundle/bundle_k8s_linux.go +++ b/src/go/rpk/pkg/cli/debug/bundle/bundle_k8s_linux.go @@ -79,6 +79,7 @@ func executeK8SBundle(ctx context.Context, bp bundleParams) error { saveNTPDrift(ps), saveResourceUsageData(ps, bp.y), saveSlabInfo(ps), + saveUname(ctx, ps), } // We use the K8S to discover the cluster's admin API addresses and collect diff --git a/src/go/rpk/pkg/cli/debug/bundle/bundle_linux.go b/src/go/rpk/pkg/cli/debug/bundle/bundle_linux.go index 85467f011f6c6..8d682770d8758 100644 --- a/src/go/rpk/pkg/cli/debug/bundle/bundle_linux.go +++ b/src/go/rpk/pkg/cli/debug/bundle/bundle_linux.go @@ -155,6 +155,7 @@ func executeBundle(ctx context.Context, bp bundleParams) error { saveSysctl(ctx, ps), saveSyslog(ps), saveTopOutput(ctx, ps), + saveUname(ctx, ps), saveVmstat(ctx, ps), } @@ -699,6 +700,13 @@ func saveDNSData(ctx context.Context, ps *stepParams) step { } } +// Saves the output of `uname -a`. +func saveUname(ctx context.Context, ps *stepParams) step { + return func() error { + return writeCommandOutputToZip(ctx, ps, filepath.Join(linuxUtilsRoot, "uname.txt"), "uname", "-a") + } +} + // Saves the disk usage total within redpanda's data directory. func saveDiskUsage(ctx context.Context, ps *stepParams, y *config.RedpandaYaml) step { return func() error {