Add helper script for MAC-only fencing credential testing#81
Add helper script for MAC-only fencing credential testing#81dhensel-rh wants to merge 3 commits into
Conversation
Adds patch-devscripts-mac-fencing.sh for verifying OCPEDGE-2692 (MAC address fencing credential support in assisted-service ABI flow). The script patches three dev-scripts files on a hypervisor to generate macaddress:-based fencing credentials instead of hostname:-based ones in the install-config. Also fixes OPENSHIFT_CI case sensitivity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… cluster Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dhensel-rh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughA new Bash script ChangesMAC-Address Fencing Patch
Sequence DiagramsequenceDiagram
participant Local as Local Script
participant Inventory as inventory.ini
participant Remote as Hypervisor/SSH
participant AgentCfg as agent/05_agent_configure.sh
participant VarsFile as agent/roles/manifests/vars/main.yml
participant Template as install-config_baremetal_yaml.j2
Local->>Inventory: parse hypervisor from TNT inventory
Local->>Remote: SSH pre-flight: test dev-scripts/agent exists
Local->>Remote: Patch 0: normalize OPENSHIFT_CI, set AGENT_E2E_TEST_SCENARIO in config_*.sh
Local->>AgentCfg: Patch 1a/1b: populate AGENT_MASTER_MACS and export AGENT_MASTER_MACS_STR
Local->>VarsFile: Patch 2: add agent_master_macs from env AGENT_MASTER_MACS_STR
Local->>Template: Patch 3: replace hostname-based fencing with macaddress-based blocks
Local->>Remote: print next-step SSH and sudo make agent instructions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@dhensel-rh: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@helpers/patch-devscripts-mac-fencing.sh`:
- Around line 102-107: The sed -i operations in this script print "Applied"
messages unconditionally, even if the target anchor pattern is not found in the
file, which can mask silent failures when upstream dev-scripts changes. For the
AGENT_MASTER_MACS collection block and the other patches referenced (around
lines 109-115, 126-131, and 142-149), add validation checks before and after
each sed command: verify that the anchor pattern exists in the file before
attempting the patch, and verify that the expected content was actually inserted
after sed completes. Only print the "Applied" success message if both checks
pass, otherwise print an error message and exit or fail appropriately. This
hardening pattern should be consistently applied across all patch blocks to
prevent false success reports when patches fail to apply.
- Line 50: The SSH_OPTS variable includes StrictHostKeyChecking=no which
disables host identity verification and creates a security vulnerability. Change
the StrictHostKeyChecking option from "no" to "accept-new" (which accepts new
host keys but still verifies them on subsequent connections), or remove it
entirely to use SSH's default secure behavior. If insecure mode must be
supported, make it explicit and opt-in through an environment variable or
command-line flag that users can set when they explicitly need to bypass host
verification.
In `@helpers/README.md`:
- Around line 135-141: The "What it patches" section in helpers/README.md is
incomplete and does not document all files modified by the script. Update this
section to include the `config_*.sh` files (specifically noting the
`AGENT_E2E_TEST_SCENARIO` variable modifications and the `OPENSHIFT_CI` case
sensitivity fix from "TRUE" to "true") in addition to the 3 files already listed
under `dev-scripts/agent/`. Ensure the documentation explicitly lists the
complete patch surface to match the actual script behavior and maintain
consistency with the coding guidelines.
🪄 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: 38a1ece5-a866-4029-8304-4caa328c84a1
📒 Files selected for processing (2)
helpers/README.mdhelpers/patch-devscripts-mac-fencing.sh
- Convert SSH_OPTS from string to bash array, expand with "${SSH_OPTS[@]}"
- Auto-discover hypervisor from TNT inventory (deploy/openshift-clusters/inventory.ini)
with explicit argument as override
- Add pre-flight check for dev-scripts on the hypervisor
- Make missing config file non-fatal (Patch 0 skips gracefully)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cd43a23 to
b8b149b
Compare
Summary
helpers/patch-devscripts-mac-fencing.sh— patches dev-scripts on a hypervisor to generatemacaddress:-based fencing credentials instead ofhostname:-based ones in the ABI install-confighelpers/README.mdwith usage documentation and prerequisitesOPENSHIFT_CIcase sensitivity ("TRUE"→"true") in the dev-scripts configUsed for verifying OCPEDGE-2692 (MAC address fencing credential support in assisted-service ABI flow).
Prerequisites: Initialized hypervisor (TNT
make initormake deploy). A running cluster is not required — the script patches dev-scripts source files before deployment.Test plan
fencing-credentials.yamlgenerated correctly on agent ISO🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation