Skip to content

fix(client): inline embedded specs when parsing YAML - #138

Merged
synackd merged 1 commit into
mainfrom
fix/yaml-inlining
Aug 4, 2026
Merged

fix(client): inline embedded specs when parsing YAML#138
synackd merged 1 commit into
mainfrom
fix/yaml-inlining

Conversation

@synackd

@synackd synackd commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

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.

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • I have updated the relevant documentation (CLI examples, man pages, README, other docs, etc.)
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Dependency update

For more info, see Contributing Guidelines.

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 synackd left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hotfix for issue found when testing OpenCHAMI/release#50 with OpenCHAMI/openchami.org#100. Tests and checks passing.

@synackd
synackd merged commit dab1904 into main Aug 4, 2026
13 checks passed
@synackd
synackd deleted the fix/yaml-inlining branch August 4, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant