Skip to content

Commit

Permalink
Allow pointer values with DieStampAt callback (#107)
Browse files Browse the repository at this point in the history
The callback function can accept an argument of a compatible type, or
a pointer to that type. Using the pointer type is useful to be able to
in-place replace a value, or mutate a struct in a slice.

Signed-off-by: Scott Andrews <[email protected]>
  • Loading branch information
scothis committed Aug 1, 2023
1 parent 14089ff commit b21707f
Show file tree
Hide file tree
Showing 27 changed files with 6,834 additions and 712 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ type MyResourceDie interface {
// Experimental: DieStampAt uses a JSON path (https://goessner.net/articles/JsonPath/)
// expression to stamp portions of the resource. The callback is invoked with each
// JSON path match. Panics if the callback function does not accept a single argument
// of the same type as found on the resource at the target location.
// of the same type or a pointer to that type as found on the resource at the target
// location.
//
// Future iterations will improve type coercion from the resource to the callback
// argument.
Expand Down
63 changes: 57 additions & 6 deletions apis/admission/v1/zz_generated.die.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b21707f

Please sign in to comment.