Commit Graph

35 Commits

Author SHA1 Message Date
Karl Isenberg
43868688d5 Use require for Error and NoError
Assert keeps going after failure, but require immediately fails
the tests, making it easier to find the output related to the test
failure, rather than having to comb through a bunch of subsequent
assertion failures. For equality tests, we may or may not want to
continue, but for error checks we almost always want to immediately
fail the test. Exceptions can be changed as-needed.
2024-03-20 13:19:18 -07:00
Natasha Sarkar
96ad106ee1 Use upstream go-yaml fork and remove our internal one (#5412)
* test new yaml fork

* delete old kyaml fork

* update to sigs yaml 1.4.0

* remove comments
2023-10-25 19:48:22 +02:00
Katrina Verey
79a9154cf8 Improve error message when namespace transformer is given invalid fieldspecs
Also remove invalid+ignored fieldspecs from the defaults
2022-08-16 18:18:44 -04:00
koba1t
01ab069bd2 fix error message 2022-04-13 04:55:21 +09:00
koba1t
5e84de2a89 fix errror message using replacement wildcard and create option 2022-04-12 05:14:24 +09:00
Katrina Verey
71bf0d5d14 Update full linter list and enable some easily resolved new ones 2022-03-31 11:37:26 -04:00
Katrina Verey
14947e449b Address new linter complaints 2022-03-31 11:37:26 -04:00
Rafael Leal
97de780feb Fix error during expansion of !!merge <<: anchor tags (#4383)
* WIP

* Fix merge corner cases

* Add test for explicit !!merge tag

* Fix tests

* Cleanup

* Cleanup

* Fix deanchoring lists

* Add test case for keeping comments

* Add MapEntrySetter and fix json marshalling after deanchoring

* Keep duplicated keys

* Move MergeTag definition to yaml alias

* Remove go-spew from api

* Add support for sequence nodes on merge tags

* Add docstring to MapEntrySetter.Key

* Add docstring to MapEntrySetter struct

* Add tests to MapEntrySetter

* Fix duplicate merge key

* Revert whitespace changes on forked go-yaml

* Remove AssocMapEntry function

* Refactoring merge order

* Return errors on VisitFields and PipeE

* Add tests for each non-conforming map merges
2022-03-23 09:36:17 -07:00
Katrina Verey
7a41e479c9 Filter helper for fallback field lookup 2021-08-17 11:13:10 -07:00
Katrina Verey
2e8a3b7c45 Use the forked go-yaml module 2021-06-28 15:29:32 -07:00
Natasha Sarkar
71f4cecb4c fixed ports merging issue and refactored some kyaml.walk code 2021-02-08 17:49:10 -08:00
monopole
b7cce27d40 In kyaml, loosen interpretation of string node and add tests. 2021-01-10 12:08:50 -08:00
Natasha Sarkar
886f73aa0f added test case for no values 2020-11-06 13:14:25 -08:00
Natasha Sarkar
73d91dda6e changed handling of empty values 2020-11-06 11:42:17 -08:00
Natasha Sarkar
9f06376ab2 updated associative sequence 2020-11-05 17:22:54 -08:00
Natasha Sarkar
e785bab474 updated matchelementlist 2020-11-05 17:03:52 -08:00
Natasha Sarkar
8f80a898b6 removed elementsetterlist and updated elementsetter 2020-11-05 16:50:18 -08:00
Natasha Sarkar
a04e3a575c added test case for different length keys/values 2020-11-05 12:19:54 -08:00
Natasha Sarkar
1f806b0aa2 add elementsetterlist and elementmatcherlist to fns.go 2020-11-05 11:37:45 -08:00
Donny Xia
c803ca83a4 fix linter error 2020-11-03 15:29:01 -08:00
Donny Xia
6bed275234 add more tests for ElementSetter 2020-11-03 15:23:34 -08:00
Donny Xia
3fed68b694 clarify the comments 2020-11-03 13:09:12 -08:00
Donny Xia
be327e7443 add tests for ElementSetter 2020-11-03 11:54:44 -08:00
Donny Xia
9c7b4fddf9 code review 2020-10-20 12:39:50 -07:00
Donny Xia
92826c6a1e support array index in PathGetter 2020-10-15 16:28:09 -07:00
Donny Xia
bb60c29672 add GetElementByKey 2020-09-29 17:36:07 -07:00
Justin SB
341bacb9a2 Fix comment on SplitIndexNameValue
It was incorrect and suggested some behaviour which isn't present.
Added test to verify the documented behaviour.
2020-09-11 11:39:49 -04:00
jregan
8619c9aa13 Inline TypeMeta. 2020-08-16 17:20:30 -07:00
Donny Xia
a2693d0249 fix panic when fieldspec refers an empty value 2020-08-07 10:47:25 -07: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
Phillip Wittrock
eaaefc128f Using single quote style when setting annotations
Annotations must be strings.  Use single-quote style
so tools don't get confused about the type.
2019-12-16 18:04:46 -08:00
Arthur Mello
0bace652c3 Move repeated variable content to constants following linter suggestion 2019-12-08 07:12:48 -03:00
Arthur Mello
a077482e99 Rename struct field to solve issue raised by go vet 2019-12-05 23:06:19 -03:00
Arthur Mello
f2c7066088 Remove leading/trailing newlines following whitespace linter recommendation 2019-12-05 22:23:35 -03:00
Phillip Wittrock
efd7c8e3f7 kyaml: initial support for yaml and resource manipulation 2019-11-04 11:36:35 -08:00