Skip to content

OCPBUGS-81622: Include bootstrap gather in agent-gather archive#10501

Open
zaneb wants to merge 1 commit intoopenshift:mainfrom
zaneb:agent-bootstrap-gather
Open

OCPBUGS-81622: Include bootstrap gather in agent-gather archive#10501
zaneb wants to merge 1 commit intoopenshift:mainfrom
zaneb:agent-bootstrap-gather

Conversation

@zaneb
Copy link
Copy Markdown
Member

@zaneb zaneb commented Apr 14, 2026

If the rendezvous host is in the process of bootstrapping the cluster, collect the same logs that would be collected by the 'gather bootstrap' installer command and incorporate them into the agent-gather archive.

Summary by CodeRabbit

Chores

  • Enhanced bootstrap data gathering to collect additional system diagnostics information during the initialization process.

If the rendezvous host is in the process of bootstrapping the cluster,
collect the same logs that would be collected by the 'gather bootstrap'
installer command and incorporate them into the agent-gather archive.
@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 14, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@zaneb: This pull request references Jira Issue OCPBUGS-81622, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is Verified instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

If the rendezvous host is in the process of bootstrapping the cluster, collect the same logs that would be collected by the 'gather bootstrap' installer command and incorporate them into the agent-gather archive.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Walkthrough

The gather_bootstrap_status() function in the agent-gather script now includes an additional step that conditionally invokes an installer gather process. If the /usr/local/bin/installer-gather.sh script exists, it is executed with a timestamped identifier, with output captured to a tar.gz artifact that is subsequently decompressed.

Changes

Cohort / File(s) Summary
Bootstrap Gather Enhancement
data/data/agent/files/usr/local/bin/agent-gather
Added conditional bootstrap-gather step to gather_bootstrap_status() function that invokes installer-gather.sh if available, creating and decompressing a tar.gz artifact with a timestamped identifier.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding bootstrap gather functionality to the agent-gather archive, which aligns with the PR's core objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed PR modifies only a shell script file with no Ginkgo test patterns, so the custom check does not apply.
Test Structure And Quality ✅ Passed The custom check is not applicable to this PR as it only modifies a bash shell script, not Ginkgo test code.
Microshift Test Compatibility ✅ Passed This PR only modifies a shell script for collecting bootstrap logs and does not introduce new Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The custom check assesses Ginkgo e2e tests for Single Node OpenShift compatibility. This PR modifies only a bash shell script and does not add, modify, or remove any Ginkgo e2e tests, making the check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed This pull request modifies a bash shell utility script used for collecting diagnostic logs on the rendezvous host. It does not introduce or modify any Kubernetes deployment manifests, operators, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check does not apply to this PR. The modified file is a bash shell script used for diagnostic data gathering, not a Go binary or test extension that communicates with openshift-tests. All output statements properly redirect to stderr using >&2 redirection.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Custom check for IPv6 and disconnected network test compatibility is not applicable to this PR, which modifies a bash script rather than Ginkgo e2e tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 14, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign pawanpinjarkar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@data/data/agent/files/usr/local/bin/agent-gather`:
- Around line 124-129: The script currently unconditionally runs gunzip on
${bs_gather} even if /usr/local/bin/installer-gather.sh failed or produced no
archive; update the block that invokes installer-gather.sh and the bs_gather
variable so you check the exit status and the produced file before running
gunzip: run installer-gather.sh via TAR_FILE="${bs_gather}"
/usr/local/bin/installer-gather.sh --id ... and capture its exit code, then only
run gunzip "${bs_gather}" if the command succeeded and the file exists and is
non-empty (e.g., test -f and test -s on the bs_gather path); otherwise skip
gunzip and propagate or log the failure so the function does not falsely report
success. Ensure you reference installer-gather.sh, bs_gather, TAR_FILE and
ARTIFACTS_DIR in the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c01ad7f5-69b0-42c6-86ce-079b3fd081bf

📥 Commits

Reviewing files that changed from the base of the PR and between 075b809 and d005c8b.

📒 Files selected for processing (1)
  • data/data/agent/files/usr/local/bin/agent-gather

Comment on lines +124 to +129
if [ -f /usr/local/bin/installer-gather.sh ]; then
local bs_gather="${ARTIFACTS_DIR}/bootstrap-gather.tar.gz"
TAR_FILE="${bs_gather}" /usr/local/bin/installer-gather.sh --id "$(date '+%Y%m%d%H%M%S')" >&2
( >&2 echo -n ".")
gunzip "${bs_gather}"
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Guard gunzip behind a successful bootstrap gather result.

If installer-gather.sh fails (or produces no ${bs_gather}), Line 128 still runs and the function ends with " Done", resulting in a misleading success path and missing bootstrap logs in the archive.

💡 Proposed fix
-	if [ -f /usr/local/bin/installer-gather.sh ]; then
+	if [ -x /usr/local/bin/installer-gather.sh ]; then
 		local bs_gather="${ARTIFACTS_DIR}/bootstrap-gather.tar.gz"
-		TAR_FILE="${bs_gather}" /usr/local/bin/installer-gather.sh --id "$(date '+%Y%m%d%H%M%S')" >&2
-		( >&2 echo -n ".")
-		gunzip "${bs_gather}"
+		if TAR_FILE="${bs_gather}" /usr/local/bin/installer-gather.sh --id "$(date '+%Y%m%d%H%M%S')" >&2 && [ -s "${bs_gather}" ]; then
+			( >&2 echo -n ".")
+			gunzip "${bs_gather}"
+		else
+			( >&2 echo ".. Skipping bootstrap gather archive: installer-gather failed or produced no output.")
+		fi
 	fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ -f /usr/local/bin/installer-gather.sh ]; then
local bs_gather="${ARTIFACTS_DIR}/bootstrap-gather.tar.gz"
TAR_FILE="${bs_gather}" /usr/local/bin/installer-gather.sh --id "$(date '+%Y%m%d%H%M%S')" >&2
( >&2 echo -n ".")
gunzip "${bs_gather}"
fi
if [ -x /usr/local/bin/installer-gather.sh ]; then
local bs_gather="${ARTIFACTS_DIR}/bootstrap-gather.tar.gz"
if TAR_FILE="${bs_gather}" /usr/local/bin/installer-gather.sh --id "$(date '+%Y%m%d%H%M%S')" >&2 && [ -s "${bs_gather}" ]; then
( >&2 echo -n ".")
gunzip "${bs_gather}"
else
( >&2 echo ".. Skipping bootstrap gather archive: installer-gather failed or produced no output.")
fi
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@data/data/agent/files/usr/local/bin/agent-gather` around lines 124 - 129, The
script currently unconditionally runs gunzip on ${bs_gather} even if
/usr/local/bin/installer-gather.sh failed or produced no archive; update the
block that invokes installer-gather.sh and the bs_gather variable so you check
the exit status and the produced file before running gunzip: run
installer-gather.sh via TAR_FILE="${bs_gather}"
/usr/local/bin/installer-gather.sh --id ... and capture its exit code, then only
run gunzip "${bs_gather}" if the command succeeded and the file exists and is
non-empty (e.g., test -f and test -s on the bs_gather path); otherwise skip
gunzip and propagate or log the failure so the function does not falsely report
success. Ensure you reference installer-gather.sh, bs_gather, TAR_FILE and
ARTIFACTS_DIR in the change.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 14, 2026

@zaneb: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-agent-compact-ipv4-iso-no-registry d005c8b link false /test e2e-agent-compact-ipv4-iso-no-registry
ci/prow/e2e-agent-two-node-fencing-ipv4 d005c8b link false /test e2e-agent-two-node-fencing-ipv4
ci/prow/okd-scos-images d005c8b link true /test okd-scos-images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants