forked from kubernetes-sigs/kustomize
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix null YAML values being replaced by
"null"
Related issues: * kubernetes-sigs#5031 * kubernetes-sigs#5171 After noting this behaviour was not present in d89b448 a `git bisect` pointed to the change 1b7db20. The issue with that change is that upon seeing a `null` node it would replace it with a node whose value was equivalent but without a `!!null` tag. This meant that one application of a patch would have the desired approach: the result would be `null` in the output, but on a second application of a similar patch the field would be rendered as `"null"`. To avoid this, define a special flag node that is `null` but never removed during merges. The added `TestApplySmPatch_Idempotency` test verifies this behaviour. However, this approach will may change the value of the node in the output, e.g. if originally there was `field: ~` it would be replaced by `field: null`. The added test case in `kyaml/yaml/merge2/scalar_test.go` demonstrates this behaviour (this test currently fails as I expect the desired outcome is to preserve the null marker) See also kubernetes-sigs#5365 for an alternative approach
- Loading branch information
1 parent
dd49bd4
commit 3532f6b
Showing
4 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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