Katrina Verey
04e1663b70
appendCsVAnnotation must mutate the annotations RNode in place
...
Otherwise, it is incompatible with filters like fieldSpec.Filter that recurse through a tree of RNodes. In the case of the bug this commit fixes, the leaf RNode is a metadata.annotation value field, and appendCsvAnnotation is called immediately before updating that leaf's value. If appendCsvAnnotation replaces the entire metadata.annotation RNode on the resource, the leaf RNode that gets updated is no longer attached to the resource.
Alternatively, `func (f Filter) setScalar` could be updated to change
the value of the leaf RNode BEFORE calling appendCsvAnnotation. However,
the modification of the entire metadata segment of the RNode in a
function that nominally just edits an annotation feels like a
side-effect prone to creating other difficult-to-debug situations,
beyond this ordering dependency.
2022-07-11 19:58:49 -04:00
Katrina Verey
71bf0d5d14
Update full linter list and enable some easily resolved new ones
2022-03-31 11:37:26 -04:00
natasha41575
4f21d60045
helper methods, types, and unit tests for transformer annotations
2021-12-29 15:27:34 -08:00
Natasha Sarkar
964bb38ba2
add origin annotation for resources generated by generators ( #4341 )
...
* add origin annotation for resources generated by builtin and custom generators
* decouple origin data from generator data and account for inline generators
2021-12-23 10:40:29 -08:00
Mengqi Yu
bd7bad19a1
add to BuildAnnotations
2021-11-19 12:13:12 -08:00
natasha41575
b4a69f08c0
provide utility helpers for preserving internal annotations
2021-10-29 12:30:55 -07:00
Natasha Sarkar
67a5f6d68f
support krm spec v1 and legacy path, index, and id annotations
2021-09-17 17:10:10 -07:00
Natasha Sarkar
9a27a9f19f
replace genargs with two separate annotations
2021-07-29 15:46:09 -07:00
Natasha Sarkar
97e7cb1512
remove annotations added by the kyaml reader
2021-07-27 17:56:58 -07:00
Natasha Sarkar
91f74e8d16
replace Resource.options with annotations ( #4061 )
2021-07-23 18:19:05 -07:00
Natasha Sarkar
a84badb834
replace Resource.refBy with annotations
2021-07-07 15:22:36 -07:00
monopole
86dd74fd62
Gather some string slice utils.
2021-06-10 13:34:20 -07:00
Natasha Sarkar
6adefe4562
replacements should be able to use previous IDs
2021-06-03 12:14:27 -07:00
monopole
5c4e363f11
Remove delegation to RNode in Resource.
2021-05-11 10:49:17 -07:00
monopole
01ddeb476d
Introduce resmap.ApplyFilter.
2021-05-10 20:47:57 -07:00
monopole
82abd7e9ea
Simplify kind and name change code.
2021-05-09 16:20:39 -07:00
monopole
660847225d
Simplify gvk, speed up cluster-scoped checks.
2021-05-02 13:17:33 -07:00
monopole
c8dddac5b9
Move resid package from api to kyaml
2021-04-30 20:39:32 -07:00
Natasha Sarkar
038bc7713b
add replacement transformer
2021-04-15 14:12:33 -07:00
Kubernetes Prow Robot
297bdc3825
Merge pull request #3727 from monopole/fix3394
...
Allow patch removal of emptyDir {}
2021-03-16 10:06:35 -07:00
Jeff Regan
5247aa5750
Update resource.go
2021-03-15 22:22:43 -07:00
monopole
74d5646526
Allow patch removal of emptyDir {}
2021-03-15 18:34:36 -07:00
monopole
235101a614
Drop uses of 'unstructured' terminology.
2021-03-15 15:59:06 -07:00
monopole
123a5d6e56
Remove the wrappy layer.
2021-03-15 15:59:06 -07:00
Natasha Sarkar
f96ac2d61e
allow general name and kind changes via an options field in patches
2021-03-10 14:58:58 -08:00
Natasha Sarkar
722b0131f0
return error for duplicate keys rather than panicking
2021-03-03 12:13:24 -08:00
Donny Xia
6518393f5d
support binaryData merge
2021-02-11 15:34:16 -08:00
Natasha Sarkar
43157f5d35
cleaned up resource refactoring
2021-02-03 14:30:25 -08:00
Natasha Sarkar
cd918483f9
removed some prefix methods from resource
2021-02-03 12:02:12 -08:00
Natasha Sarkar
f71854a0c8
Refactored resource to store all previous names and namespaces
2021-02-03 12:01:09 -08:00
monopole
d3ea87220b
Fix Issue 3489.
2021-02-03 10:49:17 -08:00
monopole
aae2be1a79
Add tests in support of Issue 3489.
2021-02-02 18:35:46 -08:00
monopole
64644643d4
Improve name reference transformer testing.
2021-01-31 08:40:47 -08:00
monopole
2cb972de3b
Rename id annotations to build annotations.
2021-01-15 06:43:13 -08:00
monopole
bb41d018b5
Add more tests and explain some strange quotes.
2021-01-13 15:49:12 -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
monopole
c2fbb709da
Don't swallow error in SM patch and use new RNode Map method.
2021-01-09 07:00:21 -08:00
monopole
614e853db3
Confine calls to ApplyToJSON.
2021-01-07 20:31:10 -08:00
jregan
9ddf0fe304
Eliminate extraneous label and anno maps.
2020-12-22 08:37:40 -08:00
jregan
735befef19
Add kunstruct impl of Get/SetDataMap, replace Resource.Merge
2020-12-21 07:22:03 -08:00
jregan
1a5aa63d54
Spelling nits.
2020-12-04 12:29:39 -08:00
jregan
4a55a07c14
Patchtransformers - drop copied code, improve deletion handling.
2020-11-30 11:58:43 -08:00
jregan
5248fd0cd9
In some tests, replace reflection with yaml compare.
2020-11-22 18:48:32 -08:00
Natasha Sarkar
7c8c827a88
added IsEmpty() method
2020-09-30 12:17:14 -07:00
Donny Xia
6a7afd8694
fix name reference with prefixsuffix
2020-08-25 12:25:37 -07:00
jregan
d5f868c5c7
Gvk.ParseGroupVersion function.
2020-08-21 15:40:37 -07:00
jregan
edced4b3f6
Delete newly orphaned code.
2020-08-20 13:12:06 -07:00
jregan
e783af2881
Delegate to Kunstructured.
2020-06-19 15:06:13 -07:00
Phillip Wittrock
c2dc7ae789
revert pseudo/k8s deps
2019-12-11 15:28:04 -08:00