Commit Graph

163 Commits

Author SHA1 Message Date
monopole
bb41d018b5 Add more tests and explain some strange quotes. 2021-01-13 15:49:12 -08:00
Donny Xia
64beee22e9 fix GetFieldValue cannot handle slice index 2021-01-13 14:14:01 -08:00
monopole
c68cf40d75 Add a test that only loads an annotated resource. 2021-01-13 10:56:50 -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
monopole
14a1a0e4a8 Fix 3424 by avoiding a JSON round trip 2021-01-10 20:39:01 -08:00
Jeff Regan
e5e19f7c09 Merge pull request #3431 from Shell32-Natsu/newline
keep \n in the end of resource yaml
2021-01-10 12:51:36 -08:00
monopole
30dcf38609 Add var ref replacement tests and more doc. 2021-01-10 09:16:52 -08:00
monopole
769f65d6c4 Short circuit anno/label transformer for performance. 2021-01-08 18:02:58 -08:00
Donny Xia
378eaedc82 keep \n in the end of resource yaml 2021-01-08 15:36:36 -08:00
monopole
8c6a9f6495 Move plugin lister to avoid import cycle. 2021-01-07 18:46:04 -08:00
monopole
69cade143f Add test for issue 3424 2021-01-06 16:23:12 -08:00
Jeff Regan
979fe3b457 Merge pull request #3401 from monopole/close3393
Regression coverage for configmap generation.
2020-12-28 13:09:37 -08:00
jregan
c113c41c9c Regression coverage for configmap generation. 2020-12-28 09:53:34 -08:00
jregan
99c9edfc3d Drop close in timed call. 2020-12-28 08:31:42 -08:00
jregan
24c4c66403 Close 3343 2020-12-26 10:43:58 -08:00
jregan
dd1df5a30e Remaining problems. 2020-12-26 09:28:01 -08:00
jregan
eb26d79fa0 Isolate patch conflation problem to one test.
See #3394
2020-12-26 08:41:48 -08:00
jregan
1426137883 Isolate scalar quoting oddities to one test set.
The apimachinery code path, in its final marshalling
for output, calls Marshall

  https://github.com/go-yaml/yaml/blob/v2/yaml.go#L199

This code path (via apimachinery Unstructured types)
has no JSON schema tags

  https://yaml.org/spec/1.2/spec.html#id2803311

so it adds quotes to values that smell like
booleans and ints (e.g. `false` becomes `"false"`).

The kyaml code path, OTOH, uses such tags,
so generally does not quote ints and booleans.

This PR isolates this difference in behavior to
one set of tests (using data fields in configmaps
in api/krusty/configmaps_test.go) so that
they don't confuse other tests that cover
completely different behaviors.
2020-12-23 17:08:25 -08:00
jregan
8b97274af3 More merge tests, clearer method names. 2020-12-22 17:26:12 -08:00
jregan
9ddf0fe304 Eliminate extraneous label and anno maps. 2020-12-22 08:37:40 -08:00
Jeff Regan
8a952a1b26 Merge pull request #3384 from monopole/badBlank
Fix roleref test failing under enableKyaml
2020-12-22 06:47:55 -08:00
jregan
fff484e98b Fix test failing under enableKyaml 2020-12-22 06:24:27 -08:00
jregan
735befef19 Add kunstruct impl of Get/SetDataMap, replace Resource.Merge 2020-12-21 07:22:03 -08:00
jregan
c32a809dbd Fix formatting nit with enableKyaml 2020-12-17 11:21:46 -08:00
jregan
bd27d5f8bb Fix apiversion slash 2020-12-17 08:42:15 -08:00
JaredTan95
2361b70967 fix unit test 2020-12-16 10:05:04 +08:00
JaredTan95
97402f1136 update crd_test.go api version. 2020-12-15 12:20:10 +08:00
jregan
6bbc829593 Add a loader test. 2020-12-09 17:17:21 -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
Natasha Sarkar
deb2b21cbe added allowresourceidchanges bool to options struct 2020-12-02 18:02:09 -08:00
jregan
a5f3d5c823 Use DepProvider in tests to access kyaml impls. 2020-11-21 14:49:44 -08:00
Donny Xia
98900c43f7 fix invalid managed-by label value 2020-11-16 14:05:21 -08:00
Donny Xia
abc88c56c4 support inline transformer and generator 2020-11-12 15:19:14 -08:00
jregan
a468743b81 Disable helm inflator tests. 2020-11-10 15:22:25 -08:00
Donny Xia
64f8d2ae38 add one more test 2020-11-10 10:25:05 -08:00
Donny Xia
e75d4fc87d convert helm inflator to builtin plugin 2020-10-30 23:18:54 -07:00
Jeff Regan
119d7cadf5 Merge pull request #3136 from natasha41575/NamespaceabilityFromOpenAPI
removed hardcoded list of namespaceable resources
2020-10-26 12:22:36 -07:00
Natasha Sarkar
49dced2e01 removed hardcoded list of namespaceable resources 2020-10-23 11:47:29 -07:00
Donny Xia
62a8a8c57d check Gvk in roleRef when update name reference 2020-10-19 14:01:13 -07:00
Donny Xia
e695b0534d Add metadata field to kustomization file 2020-10-05 11:20:41 -07:00
Jeff Regan
2fb8603b2a Merge pull request #3050 from Shell32-Natsu/deployment-annotation
support var ref in deployment template annotations
2020-10-02 14:01:32 -07:00
Donny Xia
74d0d7960e add option to choose prepend/append in merge 2020-10-02 09:56:59 -07:00
Donny Xia
a4f6fee6c8 support var ref in deployment template annotations 2020-09-30 10:21:03 -07:00
Natasha Sarkar
bd534441ce fixed issue 2896 2020-09-28 11:01:01 -07:00
Kubernetes Prow Robot
4c48a4ff83 Merge pull request #3033 from Shell32-Natsu/3021
fix multiple match issue in rolebinding
2020-09-25 17:22:48 -07:00
Jeff Regan
1320e0c3dc Merge pull request #2999 from aodinokov/fixenv
Added list of env variables for fn-plugins
2020-09-25 17:00:28 -07:00
Donny Xia
b51e09d5fe fix multiple match issue in rolebinding 2020-09-23 13:03:12 -07:00
Natasha Sarkar
ce0dba9217 fixed bug in base test 2020-09-21 11:32:26 -07:00
Natasha Sarkar
9abd0119e1 test for issue 2896 2020-09-21 11:25:54 -07:00
Alexey Odinokov
64cbfbe56d added test for env vars 2020-09-21 06:14:09 +00:00