-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Fix Status logic for HostFirmwareComponents #1695
Conversation
/test metal3-bmo-e2e-test-pull |
/test metal3-centos-e2e-integration-test-main |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dtantsur The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test metal3-bmo-e2e-test-pull |
/test metal3-centos-e2e-integration-test-main |
/test metal3-bmo-e2e-test-pull |
/lgtm |
/ok-to-test |
/test metal3-centos-e2e-integration-test-main |
The panic in the BMO log seems valid but the fact it shows L161 (which is a comment is a bit weird)...
/test metal3-centos-e2e-integration-test-main |
@@ -1162,21 +1162,21 @@ func (p *ironicProvisioner) GetFirmwareComponents() ([]metal3api.FirmwareCompone | |||
if !p.availableFeatures.HasFirmwareUpdates() { | |||
return nil, fmt.Errorf("current ironic version does not support firmware updates") | |||
} | |||
|
|||
// Setting to 2 since we only support bmc and bios | |||
componentsInfo := make([]metal3api.FirmwareComponentStatus, 0, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inefficiency of writing the simpler componentsInfo := []metal3api.FirmwareComponentsStatus{}
(or var componentsInfo []metal3api.FirmwareComponentsStatus
) here is dwarfed by the inefficiency of storing wholes structs instead of pointers in the array, so all the data has to be copied every time it is passed around.
/test metal3-centos-e2e-integration-test-main |
/test metal3-centos-e2e-integration-test-main |
/test metal3-centos-e2e-integration-test-main |
/test metal3-centos-e2e-integration-test-main |
Make Updates and Components optional in HostFirmwareComponentsStatus, so we don't get errors when they are empty. The UpdatedAt field for FirmwareComponentStatus can be nil, this caused runtime error in the BMO. Change logic in GetFirmwareComponents, so we fail earlier in case is not supported, now we raise a specific error ErrFirmwareUpdateUnsupported. Simplify the logic in the Controller, so we handle conditions in only one function Signed-off-by: Iury Gregory Melo Ferreira <imelofer@redhat.com>
/test metal3-centos-e2e-integration-test-main |
/lgtm |
/cherry-pick release-0.6 As agreed @kashifest and @dtantsur |
@tuminoid: new pull request created: #1749 In 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 kubernetes/test-infra repository. |
What this PR does / why we need it: metal3-io/metal3-docs#364