fix(client): inline embedded specs when parsing YAML - #138
Merged
Conversation
Flat YAML payloads only populated the wrapper's name field for fabrica service resource specs (e.g. BootConfigSpec) because yaml.v3 does not automatically inline anonymous embedded structs. As a result, fields such as kernel, initrd, params, and MACs were silently ignored and empty specs were sent to the service. Add the `yaml:",inline"` tag to every simple API spec wrapper so YAML fields are decoded into their embedded boot-service and metadata-service specifications. Do not add an equivalent JSON tag because encoding/json already promotes fields from anonymous embedded structs. Add regression tests covering flat YAML decoding for boot configurations, BMCs, nodes, cluster defaults, groups, instance information, and WireGuard peers. This ensures the CLI's YAML and JSON payload formats retain the same flat simple-API structure. Signed-off-by: Devon Bautista <17506592+synackd@users.noreply.github.com>
synackd
commented
Aug 4, 2026
synackd
left a comment
Collaborator
Author
There was a problem hiding this comment.
Hotfix for issue found when testing OpenCHAMI/release#50 with OpenCHAMI/openchami.org#100. Tests and checks passing.
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.
Description
Flat YAML payloads only populated the wrapper's name field for fabrica service resource specs (e.g.
BootConfigSpec) becauseyaml.v3does not automatically inline anonymous embedded structs. As a result, fields such askernel,initrd,params, andmacswere silently ignored and empty specs were sent to the service.Add the
yaml:",inline"tag to every simple API spec wrapper so YAML fields are decoded into their embedded boot-service and metadata-service specifications. Do not add an equivalent JSON tag becauseencoding/jsonalready promotes fields from anonymous embedded structs.Add regression tests covering flat YAML decoding for boot configurations, BMCs, nodes, cluster defaults, groups, instance information, and WireGuard peers. This ensures the CLI's YAML and JSON payload formats retain the same flat simple-API structure.
Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryType of Change
For more info, see Contributing Guidelines.