Commit Graph

19 Commits

Author SHA1 Message Date
Ed Overton
691b7d1df3 fix: patch additions honor source key style
When a patch appends a new node, it should honor the key style from the
patch. Prior to this commit, no style was applied, leading to problems
when the key value could be interpreted as a different type based on its
content. For example, "9110" needs quoting to ensure it is seen as a
string in yaml.
2023-06-08 17:21:46 -04:00
brianpursley
adedca09f2 Add unit tests for current behavior of three way merge 2021-08-02 20:36:28 -04:00
Natasha Sarkar
155c42679c cleaned comments 2020-11-09 20:17:51 -08:00
Natasha Sarkar
df0576a270 use merge key tuple instead of single merge key 2020-11-09 11:34:31 -08:00
Donny Xia
7966386615 improve format 2020-11-06 15:17:56 -08:00
Natasha Sarkar
c0ecd1d1ad added more tests 2020-11-04 19:07:58 -08:00
Natasha Sarkar
3923c63182 added some tests to merge3/element_test.go 2020-11-04 19:07:58 -08:00
Phani Teja Marupaka
25e30de2d6 Update setter comments correctly on updates 2020-08-15 03:46:33 -07:00
jregan
5559601ecb Add tests for IsTaggedNull, IsYNodeEmptySeq and IsYNodeEmptyMap. 2020-08-09 12:29:35 -07:00
jregan
31c59bd7f2 Drop all calls to IsEmpty. 2020-08-09 10:47:06 -07:00
Donny Xia
d59d0401f4 Keep empty map in kustomize output 2020-08-06 13:21:38 -07:00
Phani Teja Marupaka
4e74947731 Update setter comments during 3-way merge 2020-08-03 11:55:34 -07:00
Phani Teja Marupaka
f81d766584 Kustomization openapi 2020-04-13 23:21:17 -07:00
Khris Richardson
fcfe798b75 convert tests to exercise openapi and inference 2020-03-03 18:50:02 -08:00
Phillip Wittrock
5d1a0346b5 Use OpenAPI when merging (3way) resources
- When merging (3way) resources use the patch strategy from the openAPI if the definition exists for the field
- Allow disabling of guessing patch strategy merge keys when no definition exists
- Support defining strategy and key directly on configuration fields through line and header coments
- Support attaching schema to parent fields of lists, and propagating -- e.g. that a field is a PodTemplate
2020-03-02 20:56:53 -08:00
Phillip Wittrock
98431f6a00 fix kyaml issue where dropping Style created issues
dropping the node style creates a compatibility issue where quotes around "on" are dropped
because yaml.v3 interprets it as a string.

other yaml parsers interpret on as a bool value, and parse it as a bool rather than string.

fix: retain the original style so it is kept as quoted.

- fmt: don't drop the styles
- merge2: keep the style when merging elements
- setting a field: if changing the value of a scalar field, retain its style by default
2019-12-19 20:25:31 -08:00
Arthur Mello
d4fa006ccb Remove leading/trailing newlines following whitespace linter recommendation 2019-12-05 23:49:00 -03:00
Phillip Wittrock
3345464b25 kyaml: refactor command documentation into .md files from go files
No new documentation added.
2019-11-22 12:22:25 -08:00
Phillip Wittrock
efd7c8e3f7 kyaml: initial support for yaml and resource manipulation 2019-11-04 11:36:35 -08:00