[release-4.20] Bug OCPBUGS-78745: PR2774 and PR2793 backports#470
[release-4.20] Bug OCPBUGS-78745: PR2774 and PR2793 backports#470jacob-anders wants to merge 12 commits intoopenshift:release-4.20from
Conversation
This change introduces the InspectionMode field from the BMH v1beta1 design proposal. It partly replaces the inspection annotation (namely, its "disabled" value) by something more user-friendly and consistent with AutomatedCleaningMode. The "disabled" value of the inspection annotation is now deprecated. Other values are not affected by this change. Assisted-By: Claude Code Signed-off-by: Dmitry Tantsur <dtantsur@protonmail.com> (cherry picked from commit 414775e72baaea3dfac8ebd1e77756821ab55a52)
Signed-off-by: Sharat Akhoury <sakhoury@redhat.com> (cherry picked from commit 6f2a2016cfb3fcd7414ae53b661fb07f8850bf8d)
Signed-off-by: Sunnatillo <sunnat.samadov@est.tech> (cherry picked from commit c30b92f3a79b6c659615b271a0b4ca6cba8652b8)
This enables the E2E tests to disable certificate verification depending on the value in the BMCs config file. It can be useful if running the suite against real hardware. Signed-off-by: Lennart Jern <lennart.jern@est.tech> (cherry picked from commit 2f8a0d51d4dbdf3594ce123108582cd8b5526a0b)
Virtual media BMC drivers (redfish-virtualmedia, idrac-virtualmedia, ilo5-virtualmedia) can boot from virtual media and discover the MAC address during hardware inspection. Therefore, bootMACAddress is optional when inspection is enabled but still required when inspection is disabled (since there's no other way to discover the MAC address). This change updates the virtual media driver implementations to return false from their NeedsMAC() methods, and adds validation logic to require bootMACAddress when virtual media is used with inspection disabled. Drivers that require PXE boot (like libvirt, ipmi) continue to require bootMACAddress in all cases. Changes: - pkg/hardwareutils/bmc/redfish_virtualmedia.go: NeedsMAC() returns false - pkg/hardwareutils/bmc/idrac_virtualmedia.go: NeedsMAC() returns false - internal/webhooks/metal3.io/v1alpha1/baremetalhost_validation.go: Add logic to require bootMACAddress for virtual media when inspection is disabled (via InspectionMode field or inspect.metal3.io annotation) - pkg/provisioner/ironic/ironic.go: Skip MAC-based port queries when bootMACAddress is empty to prevent false MAC conflicts Test Coverage: - internal/webhooks/metal3.io/v1alpha1/baremetalhost_validation_test.go: * bootMACAddress not required for virtual media with inspection enabled * bootMACAddress required for virtual media with inspection disabled * bootMACAddress valid when provided for virtual media with inspection disabled - pkg/hardwareutils/bmc/access_test.go: Update virtual media test expectations (needsMac: false) Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Don Penney <dpenney@redhat.com> (cherry picked from commit dcabe115c874324cd6a6422f1ba7d305890c8c33)
Changes:
1. Restore case-insensitive MAC comparison using strings.EqualFold()
- The EqualFold check was removed inadvertently but is necessary for
case-insensitive bootMACAddress validation
2. Use existing host.InspectionDisabled() method
- Remove duplicate isInspectionDisabled() function
- Replace custom implementation with the existing BareMetalHost method
- The host.InspectionDisabled() method provides identical functionality
Assisted-by: Claude (AI Assistant)
Signed-off-by: Don Penney <dpenney@redhat.com>
(cherry picked from commit c91140004b583b96b4b55322c1045e4449e64d2f)
Simplify the conditional logic for determining when a MAC address is required. The new approach uses a single boolean expression instead of separate assignment and conditional check, improving code readability while maintaining the same functionality. Assisted-by: Claude (AI Assistant) Signed-off-by: Don Penney <dpenney@redhat.com> (cherry picked from commit 0dfd43aee8c60af5b69c48dc3514175e0e4de75c)
Signed-off-by: Sharat Akhoury <sakhoury@redhat.com> (cherry picked from commit 298f6232068476d96e7f40b5114e1fd368043983)
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jacob-anders 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 |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Refresh vendored copies of baremetalhost_types.go, idrac_virtualmedia.go, and redfish_virtualmedia.go to match cherry-picked commits from PRs metal3-io#2774 and metal3-io#2793.
Update expected error to match Go 1.24+ stricter IPv6 URL parsing. (cherry picked from commit b3042a3)
The RHACM InfraEnv compatibility block in host_state_machine.go is downstream-only code that called inspectionDisabled(), which was removed by the InspectionMode cherry-pick. Replace with the equivalent hsm.Host.InspectionDisabled() method.
The test sub-module has its own vendor directory that also needs refreshing after the cherry-picks.
|
@jacob-anders: 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. |
|
@jacob-anders: This pull request references Jira Issue OCPBUGS-78745, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
/jira refresh |
|
@jacob-anders: This pull request references Jira Issue OCPBUGS-78745, which is invalid:
Comment 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. |
This is an attempt to backport
metal3-io#2793
and
metal3-io#2774
along with other commits required for the cherry-picks to apply cleanly