NO-JIRA: fix: use typed credentials key to support MAC-based fencing in ABI flow#10477
NO-JIRA: fix: use typed credentials key to support MAC-based fencing in ABI flow#10477fracappa wants to merge 1 commit into
Conversation
|
@fracappa: This pull request explicitly references no jira issue. DetailsIn response to this:
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughFencing credential handling is refactored from a plain ChangesTyped Fencing Credential Key Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (12 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10477 +/- ##
==========================================
- Coverage 44.35% 44.34% -0.01%
==========================================
Files 420 420
Lines 73068 73262 +194
==========================================
+ Hits 32406 32486 +80
- Misses 37730 37840 +110
- Partials 2932 2936 +4
🚀 New features to boost your workflow:
|
fonta-rh
left a comment
There was a problem hiding this comment.
Review: PR #10477 — Typed credentials key for MAC-based fencing in ABI flow
Reviewed the bug report, the fix, cross-repo compatibility (installer contract, CEO impact), and test coverage. The PR is correct — all three bugs from PR #10385 are real and properly fixed:
- Untyped string keys → Fixed by
credentialKeystruct with explicitkeyTypediscriminator. The oldmap[string]approach was the root cause —LoadHostConfigscouldn't distinguish hostname keys from MAC keys. - Bogus hostname configs from MAC keys → Fixed by skipping MAC-keyed entries in the hostname-config creation loop (line 361). Old behavior created phantom
hostConfig{hostname: "aa:bb:cc:dd:ee:01"}entries that triggered misleading warnings andmissingHostfailures. - Wrong directory for fencing file → Fixed by
fencingConfigDirfield. MAC-based configs correctly resolve to the parent directory containingfencing-credentials.yamlinstead of the per-host subdirectory.
The integration test (LoadHostConfigs with MAC-only fencing credentials) is the key addition — it covers the full pipeline that #10385 missed, and would have caught all three bugs.
Cross-repo compatibility verified: installer's yaml:"macaddress,omitempty" matches assisted-service's yaml:"macaddress". Both sides normalize MACs to lowercase. No CEO impact (ABI-only path).
One minor issue
host_config.go:284 — log.Infof("Adding fencing credentials for hostname %s", config.hostname) will log an empty hostname for MAC-based configs. Pre-fix, this line was unreachable for MAC configs (credentials returned nil). Post-fix, MAC configs correctly return credentials, making this line reachable with config.hostname == "".
Suggested fix:
if config.hostname != "" {
log.Infof("Adding fencing credentials for hostname %s", config.hostname)
} else {
log.Infof("Adding fencing credentials via MAC address match")
}Not blocking — the fix is correct as-is. This is a log clarity improvement for operators debugging fencing credential application.
e072531 to
ce5d969
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fracappa 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 |
|
/retest |
|
@fracappa: all tests passed! 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. |
MAC-only fencing credentials were broken in the ABI path because
loadFencingCredentialskeyed all entries as plain strings, causingLoadHostConfigsto createhostname-basedconfigs with MAC addresses as hostnames. IntroducecredentialKeystruct to distinguish hostname from MAC keys, skiphostname-configcreation for MAC entries, andadd
fencingConfigDirso MAC-matched configs find the credentials file in the parent directory.This is a follow-up for PR #10385
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Checklist
docs, README, etc)Reviewers Checklist
Summary by CodeRabbit
Bug Fixes
Tests