Skip to content

Rename ABI-specific baremetal vars to AGENT_BAREMETAL_* prefix#97

Open
fonta-rh wants to merge 2 commits into
openshift-eng:mainfrom
fonta-rh:agent-baremetal-var-rename
Open

Rename ABI-specific baremetal vars to AGENT_BAREMETAL_* prefix#97
fonta-rh wants to merge 2 commits into
openshift-eng:mainfrom
fonta-rh:agent-baremetal-var-rename

Conversation

@fonta-rh

@fonta-rh fonta-rh commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rename BAREMETAL_IPSAGENT_BAREMETAL_IPS, BAREMETAL_ISO_SERVERAGENT_BAREMETAL_ISO_SERVER, BAREMETAL_MACSAGENT_BAREMETAL_MACS in baremetal-adopt.sh
  • Keep BAREMETAL_API_VIP and BAREMETAL_INGRESS_VIP as-is (platform-level, used by both IPI and ABI in network.sh)

Why

Aligns with dev-scripts#1922 naming convention. dtantsur's review requested that ABI-specific config vars use the AGENT_ prefix to distinguish them from platform-level vars. The rename was applied in dev-scripts; this PR updates the generator side.

Dependency chain

metal3-dev-env#1708  ─── upstream RHEL 10 fix (independent)
        │
        ▼
  This PR (TNT)  ──────── generates AGENT_BAREMETAL_* var names
        │
        ▼
dev-scripts#1922  ─────── consumes AGENT_BAREMETAL_* var names

This PR must merge before dev-scripts#1922 — otherwise the generated config file uses old names that dev-scripts no longer reads.

/hold

Test plan

  • make shellcheck passes
  • make baremetal-adopt generates config_baremetal_fencing.sh with AGENT_BAREMETAL_* var names
  • End-to-end baremetal deploy with updated dev-scripts branch succeeds

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated bare-metal deployment configuration exports to use agent-specific node addressing and ISO server settings.
    • Improved validation to ensure required node IP and data MAC values are present during configuration generation.
    • Preserved existing handling for API VIP, external subnet, ingress VIP, and ISO URL settings.

Align with dev-scripts PR #1922 naming convention: ABI-specific vars
use the AGENT_ prefix to distinguish them from platform-level vars.

Renamed:
- BAREMETAL_IPS → AGENT_BAREMETAL_IPS
- BAREMETAL_ISO_SERVER → AGENT_BAREMETAL_ISO_SERVER
- BAREMETAL_MACS → AGENT_BAREMETAL_MACS

Kept as-is (platform-level, used by both IPI and ABI in network.sh):
- BAREMETAL_API_VIP
- BAREMETAL_INGRESS_VIP

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2026
@openshift-ci
openshift-ci Bot requested review from qJkee and slintes July 16, 2026 09:43
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fonta-rh

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: f7b291b2-4514-4d89-ab74-8f48eba58787

📥 Commits

Reviewing files that changed from the base of the PR and between 6b32c21 and 4ade565.

📒 Files selected for processing (1)
  • deploy/openshift-clusters/inventory_baremetal.ini.sample

Walkthrough

The baremetal configuration generator now exports agent-prefixed IP, MAC, and ISO server variables, while the sample inventory documents the updated MAC export name and existing validation and network exports remain unchanged.

Changes

Baremetal agent export updates

Layer / File(s) Summary
Update generated fencing exports
deploy/openshift-clusters/scripts/baremetal-adopt.sh, deploy/openshift-clusters/inventory_baremetal.ini.sample
generate_baremetal_config derives AGENT_BAREMETAL_IPS and AGENT_BAREMETAL_MACS, renames the ISO server export to AGENT_BAREMETAL_ISO_SERVER, and updates the inventory comment for the MAC export. Existing VIP and subnet exports remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: slintes, qjkee

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Ai-Attribution ⚠️ Warning Commit 4ade565 uses Co-Authored-By for coderabbitai and Claude Opus, but has no Assisted-by/Generated-by trailer. Replace AI co-author lines with a Red Hat Assisted-by or Generated-by trailer, or remove AI attribution if it wasn’t needed.
✅ 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 accurately summarizes the main change: renaming baremetal ABI-specific variables to the AGENT_BAREMETAL_* prefix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Weak-Crypto ✅ Passed Touched files only rename baremetal env vars/comments; baremetal-adopt.sh contains no MD5/SHA1/DES/RC4/ECB/custom crypto or secret compares.
Container-Privileges ✅ Passed PR only changes a shell script and an inventory sample; no K8s/container manifests or privileged settings were added.
No-Sensitive-Data-In-Logs ✅ Passed The patch only renames generated env vars and a sample comment; it adds no logging of secrets, tokens, PII, or internal host data.
No-Hardcoded-Secrets ✅ Passed Touched lines only rename ABI variable exports/comments; modified-region scan found no secrets or embedded-credential URLs.
No-Injection-Vectors ✅ Passed No flagged injection patterns appear in the touched files; the change only renames exported shell vars and updates a comment.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/openshift-clusters/scripts/baremetal-adopt.sh`:
- Around line 435-439: Rename the newly introduced shell locals in the baremetal
adoption logic to uppercase names: change ip_list to IP_LIST, mac_list to
MAC_LIST, and the loop index i to INDEX. Update every reference across both
affected loops, including array indexing and accumulation, without changing the
existing behavior.
- Around line 453-460: Update
deploy/openshift-clusters/inventory_baremetal.ini.sample so its data_mac
documentation references AGENT_BAREMETAL_MACS instead of BAREMETAL_MACS,
matching the export emitted by baremetal-adopt.sh.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9d7c95bb-2477-47c1-ad2a-8bf4472ece08

📥 Commits

Reviewing files that changed from the base of the PR and between 9943cf8 and 6b32c21.

📒 Files selected for processing (1)
  • deploy/openshift-clusters/scripts/baremetal-adopt.sh

Comment thread deploy/openshift-clusters/scripts/baremetal-adopt.sh
Comment thread deploy/openshift-clusters/scripts/baremetal-adopt.sh
The data_mac doc comment still referenced the old BAREMETAL_MACS name.

Co-Authored-By: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant