From 89e48385a3532c1f5ccf379f6e5d181ea05f0f20 Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Fri, 10 Jan 2025 11:08:47 -0500 Subject: [PATCH 1/2] gather: allow unconditional gather in CI In CI, we want to collect an installer log bundle so we can examine bootstrap logs that aren't retrievable from anywhere else. This is especially important for problems that might happen during early install. --- cmd/openshift-install/create.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/openshift-install/create.go b/cmd/openshift-install/create.go index 2b05f8f3977..aa385963026 100644 --- a/cmd/openshift-install/create.go +++ b/cmd/openshift-install/create.go @@ -198,6 +198,20 @@ func clusterCreatePostRun(ctx context.Context) (int, error) { } timer.StopTimer("Bootstrap Complete") + // In CI, we want to collect an installer log bundle so we can examine bootstrap logs that aren't + // collectable anywhere else. + if gatherBootstrap, ok := os.LookupEnv("OPENSHIFT_INSTALL_GATHER_BOOTSTRAP"); ok && gatherBootstrap != "" { + timer.StartTimer("Bootstrap Gather") + logrus.Infof("OPENSHIFT_INSTALL_GATHER_BOOTSTRAP is set, will attempt to gather a log bundle") + bundlePath, gatherErr := runGatherBootstrapCmd(ctx, command.RootOpts.Dir) + if gatherErr != nil { + logrus.Warningf("Attempted to gather debug logs, and it failed: ", gatherErr) + } else { + logrus.Infof("Bootstrap gather logs captured here %q", bundlePath) + } + timer.StopTimer("Bootstrap Gather") + } + // // Wait for the bootstrap to be destroyed. // From a733f78b038d8e928482375167e71b969225b9ef Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Mon, 13 Jan 2025 07:12:25 -0500 Subject: [PATCH 2/2] Update cmd/openshift-install/create.go Co-authored-by: Patrick Dillon --- cmd/openshift-install/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/openshift-install/create.go b/cmd/openshift-install/create.go index aa385963026..9ff9c752fe2 100644 --- a/cmd/openshift-install/create.go +++ b/cmd/openshift-install/create.go @@ -205,7 +205,7 @@ func clusterCreatePostRun(ctx context.Context) (int, error) { logrus.Infof("OPENSHIFT_INSTALL_GATHER_BOOTSTRAP is set, will attempt to gather a log bundle") bundlePath, gatherErr := runGatherBootstrapCmd(ctx, command.RootOpts.Dir) if gatherErr != nil { - logrus.Warningf("Attempted to gather debug logs, and it failed: ", gatherErr) + logrus.Warningf("Attempted to gather debug logs, and it failed: %q ", gatherErr) } else { logrus.Infof("Bootstrap gather logs captured here %q", bundlePath) }