Commit Graph

34 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
Brian Pursley
1b7db20504 merge2: preserve explicitly set null values
Fixed bug where an explicitly set null value in yaml was
cleared, even when the patch did not operate on that field.
2022-11-26 16:33:14 -05:00
monopole
c8dddac5b9 Move resid package from api to kyaml 2021-04-30 20:39:32 -07:00
monopole
6f6d41f17f Remove dead merge conflict code. 2021-03-17 06:35:30 -07:00
monopole
74d5646526 Allow patch removal of emptyDir {} 2021-03-15 18:34:36 -07:00
monopole
839fd2b971 Remove branching on kyaml enablement 2021-03-09 14:29:27 -08:00
monopole
11dce34407 Annotate decisions on issue 3304 in plugins. 2021-01-16 08:08:39 -08:00
Natasha Sarkar
bd4580d73a Manage name changes (prefix/suffix) via YAML annotations rather than via in-memory-only fields. 2021-01-11 13:08:45 -08:00
jregan
d08b9c30ee What is this? 2020-12-07 10:16:30 -08:00
jregan
f66e5bb923 Extract conflict detection to it's own interface.
This PR
 - defines a patch conflict detector interface,
 - extracts implementations of the interface from the
   merginator code, making the merginator code
   independent of --enable_kyaml.
 - injects those implementations into kustomize
   as a function of --enable_kyaml.

So, instead of using different merginators to combine
resmaps, this pr allows the use of a single patch merge
code path that uses different conflict detectors.

So instead of debating how to merge, we're now only
considering whether to warn on conflict detection
in one transformer.

This PR is in service of #3304, eliminating seven
instances where --enable_kyaml was consulted.  These
were cases where conflict detection wasn't an issue
(but merging patches was).
2020-12-06 08:38:45 -08:00
jregan
1a5aa63d54 Spelling nits. 2020-12-04 12:29:39 -08:00
jregan
dbaa2d6092 hacking 2020-12-02 10:23:13 -08:00
jregan
4a55a07c14 Patchtransformers - drop copied code, improve deletion handling. 2020-11-30 11:58:43 -08:00
Donny Xia
d59d0401f4 Keep empty map in kustomize output 2020-08-06 13:21:38 -07:00
Paul Kent
1a44c3c543 add test for issues raised in #2734 2020-07-28 13:22:05 -04:00
jregan
d3a7335bbc Switch namespace and patch transformers to kyaml. 2020-07-04 16:21:01 -07:00
Morten Torkildsen
98c08b2b66 Add strategic merge patch filter based on kyaml libraries 2020-04-03 13:56:20 -07:00
Jeffrey Regan
861c86a70a Simplify plugin tests. 2019-12-02 17:12:59 -08:00
Jeffrey Regan
382c330f5b Consolidate test harness to one package. 2019-12-02 12:29:10 -08:00
jregan
f3e735153f More tests, better errors. 2019-11-26 19:29:06 -08:00
Jeffrey Regan
46524d3b6a Introduce API module. 2019-10-21 13:30:31 -07:00
jregan
951d15bf17 Make api/plugins 2019-10-20 15:12:13 -07:00
Jeffrey Regan
e5c8b5ec8f Start api directory, which will become a module. 2019-10-17 14:01:20 -07:00
Jeffrey Regan
41a008e9a3 Start pluglib, a set of public, plugin specific functions. 2019-10-14 19:43:55 -07:00
Jeffrey Regan
baa0296a12 Reduce size of pgmconfig package 2019-10-03 18:22:05 -07:00
Jeffrey Regan
2d58f8b81c Break the dep between fs and pgmconfig. 2019-10-02 12:01:45 -07:00
jingfangliu
35481ec6d9 add inline patch support for Strategic Merge Patch and JSON patch 2019-07-29 14:10:57 -07:00
jingfangliu
b4038a6cd2 add testting for patch transformers 2019-07-26 14:02:52 -07:00
jingfangliu
fc78917191 support strategic merge patch with $patch: delete 2019-07-24 12:46:33 -07:00
Jerome Brette
f363acf839 Implement code review changes for ResId.Equals instead of ResId.GkvnEquals 2019-07-18 14:13:51 -05:00
Jerome Brette
5116e2f210 Improve Transformer with Namespace tests.
- Reorganize test into test tables.
- Ensure that every test case, convers SMP and JSONPatch by
  using Deployment as kind first and then "MyCRD" as kind.
- Add tests involving namespaces.
- Add tests involving reordering of patches.
2019-07-17 15:44:44 -05:00
jingfangliu
28d1bad3cb fix the ci failure 2019-07-15 18:58:52 -05:00
jingfangliu
145d07363f add labels in test patch files 2019-07-12 08:56:34 -07:00
jingfangliu
33fff655db move strategic merge patch transformer to a builtin transformer 2019-07-11 13:39:30 -07:00