Repository navigation
Conversation
An omitted resetTypes meant both "the BMC offers none" and "the read failed". The field now uses omitzero, so an empty advertised list, inline or from the ActionInfo, is stored as []. The previous omitempty tag dropped it on every marshal, including the Device's JSON deep copy. An omitted list now always means unknown. A new ResetTypesRead condition reports why the list is unknown: ResetActionMalformed, ActionInfoNotFound, ActionInfoUnreadable, ActionInfoMalformed or TooManyResetTypes. More than 16 distinct types is now unknown instead of a truncated list, which would refuse a type the BMC offers. Discovered and the rest of the inventory are unchanged, and a rejected credential still fails the whole read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reset type list of only blank or null values was stored as an empty list, which reads as "offers none" and would refuse every action. It is now unknown with ResetActionMalformed. A truncated ActionInfo body is ActionInfoMalformed rather than unreadable. The True ResetTypesRead message and the docs now say it means no read failed, not that a list was recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An empty resetTypes list cannot be told from an omitted one: the field is omitempty, and pruning, apply and other clients do not keep an empty list reliably. resetTypes goes back to #181's tag unchanged. A per-System resetTypesObserved boolean is now true only when this read got an advertised list, inline or from the ActionInfo, even an empty one. A failed read, a System that advertises no list, a list of only blanks or more than 16 types leaves it absent, so the types are unknown. ResetTypesRead keeps explaining failures for operators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An empty inline reset list next to an ActionInfo without ResetType values was observed as an empty list, which power reads as offers none and would refuse every action. With an ActionInfo, only its values now count, so that case is unknown and the live BMC check decides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
marked this pull request as ready for review
November 28, 2026 21:31
kevwilliams
approved these changes
Nov 28, 2026
kevwilliams
left a comment
Contributor
There was a problem hiding this comment.
resetTypesObserved is set only for a fully read list, and over-cap, blank or failed reads leave it unknown with a reason instead of a truncated list.
ecv
approved these changes
Nov 28, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
The flag is true only for a successfully read list (inline or ActionInfo, including empty), and every failure path I traced leaves it unset with the right reason while discovery still succeeds. Types, CRD and doc agree, and go-test, checks and all four acceptance runs at 11e0423 are green.
- Checked in
internal/redfish/reset.goandinternal/bmcdiscovery/status.go: 404, other status or timeout, malformed ActionInfo, malformed or off-System action, blank-only list and more than 16 distinct values each map to their own reason with the flag unset. 401, 403, pin mismatch and identity still fail the whole read (systemResetTypesreturns them as fatal). - No stale true:
ResetTypesObservedis rebuilt per System inobservedInventory, and thesystemsarray is atomic in the CRD, so the merge patch inreconciler.goreplaces it and anomitemptyfalse drops the key. A later successful read with a failed ActionInfo clears it (test atreset_types_test.go:197). A read that fails outright keeps the whole retained inventory, flag andResetTypesReadtogether, so the condition never contradicts the inventory it describes, and it does not touchDiscovered. - Guard mutation: dropping
p.AllowableValues != nilfailsTestResetTypesStatus; switching the inline check tolen(Allowed) != 0failsTestInventoryRecordsResetTypesandTestResetTypesStatus; moving the 16 cap failsTestResetTypesStayWithinTheSchema. The tests guard what the PR claims. - Consumer fit with fleet#179 (4c48d63) and #190 (9f489d5): #179's
resetTypesObservedis alen(ResetTypes) > 0stub marked "Replaced by system.ResetTypesObserved once discovery records it", so the swap is one line, but its test "an empty list is not observed and admits" must flip to refuse once the flag is real. Any stale true is bounded there by theDiscoveryNotCurrentwindow (twice the interval, same endpoint), and #190's worker checks the live BMC regardless, so a wrong true cannot send an action the BMC does not offer.
Follow-ups:
- The
ResetTypesRead=Truemessage "no System's reset type read failed" is easy to misread as "types were observed", which the doc has to caveat. Consider a message that distinguishes "none failed" from "some Systems advertise no list", or leave the condition False-only. - #179's snapshot does not carry the observed flag, only the offered list, so a later audit cannot tell "BMC offers none" from "unknown" for an admitted operation. Add it when the stub is replaced.
Identifynow returns the bareErrMalformedfor a bad ActionInfo where it used to return the generic unreadable-response error. Both callers (Discover, siteaccess.go) treat any non-pin, non-identity error alike, so nothing changes today. Keep it in mind if either starts matching on error text.- Agree with the PR body that #171 touches the same inventory read and status code: whichever lands second rebases, and the flag round trip test should be re-run after it.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #181. A server with no recorded reset options looked the same whether its BMC offers none or discovery failed to read them, so power operations could not tell when to refuse and when to check the live BMC.
Each discovered system now carries a flag that is true only when discovery read its advertised reset options, even an empty set.
A new Device condition tells operators why a read failed, without changing discovery's own result or failing the inventory read.
Test plan
Decisions for a person
Related to #181
🤖 Generated with Claude Code