JSON/YAML tag uses "omitempty" as the field name #5868
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened?
Hi! While doing a broad search for this pattern, I noticed that you use
"omitempty"
as the name of theReplacements
field in theReplacementTransformerPlugin
structure.kustomize/plugin/builtin/replacementtransformer/ReplacementTransformer.go
Line 20 in bb7a280
Instead, I believe you wanted to write
",omitempty"
to keep the same name but omit when empty, although, in this structure, it might conflict with the name of theReplacementList
field.What did you expect to happen?
How can we reproduce it (as minimally and precisely as possible)?
You can test this behavior with this simple Go program:
As you can see by the result, the
omitempty
key in the JSON string gets unmarshaled to theReplacements
field.Expected output
No response
Actual output
No response
Kustomize version
latest
Operating system
None
The text was updated successfully, but these errors were encountered: