fix(cmd/boot): support array patch operations for boot resources#100
Merged
Conversation
f45d6f3 to
842571f
Compare
Collaborator
Author
|
This is now ready for review and has been rebased onto the latest main. |
Generate RFC 6902 JSON Patch payloads when boot patch commands use
--add or --remove so array updates can be represented correctly. Keep
--set/--unset-only updates on the existing keyval/merge-patch path, but
switch the selected patch method automatically when array operations are
present.
Allow patch payload data to be an object or array by widening boot-service
patch client arguments from map[string]interface{} to interface{}. This lets
RFC 6902 patch documents pass through as top-level arrays.
Update --remove semantics to remove by array index instead of by value, and
document that --add appends to an existing array. Refresh the man page patch
forms to include inline -d data and align BMC, config, and node command
documentation.
Add tests for:
- RFC 6902 array payload parsing
- dot-path to JSON Pointer conversion and escaping
- keyval patch data generation
- RFC 6902 patch data generation for add/remove
- invalid remove index rejection
Signed-off-by: Devon Bautista <17506592+synackd@users.noreply.github.com>
842571f to
9243066
Compare
alexlovelltroy
approved these changes
Jun 22, 2026
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
Generate RFC 6902 JSON Patch payloads when
boot <resource> patchcommands use--addor--removeso array updates can be represented correctly. Use key-value/merge-patch method for--set-/--unsetupdates, but switch the selected patch method automatically when array operations are present.Allow patch payload data to be an object or array by widening boot-service patch client arguments from
map[string]interface{}tointerface{}. This lets RFC 6902 patch documents pass through as top-level arrays.Update
--removesemantics to remove by array index instead of by value, and document that--addappends to an existing array. Refresh the manual page patch forms to include inline-ddata and align BMC, config, and node command documentation.Add tests for:
This will likely affect #98.
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.