30 Commits

Author SHA1 Message Date
Jonathan King
b3d1df2644 Fix name in a configMapRef missing hash #5047 (#5236)
* Add regression tests

* Update PrefixesSuffixesEquals function

* Try empty prefix/suffix but fall back on duplicates

* Run gofmt

* Remove newline

* Revert unnecessary gofmt change

* Add comment
2024-04-02 12:44:11 -07:00
Peter Lobsinger
633da991d2 Only strip surrounding quotes if there are at least two characters.
Otherwise, a value consisting of a single quote character triggers a
panic:

    go test krusty/configmaps_test.go
    --- FAIL: TestDataIsSingleQuote (0.00s)
    panic: runtime error: slice bounds out of range [1:0] [recovered]
    	panic: runtime error: slice bounds out of range [1:0]
2023-03-28 14:17:47 -07:00
Katrina Verey
dd520f8889 Revert strict decoding of Kustomization due to regression in anchor handling (#5073)
* Revert strict decoding of Kustomization due to regression in anchor handling

* Empty commit
2023-03-13 13:46:47 -07:00
koba1t
6489e35b7c improve error messages 2023-01-07 03:30:16 +09:00
yugo kobayashi
5fed0f76c8 refactor Unmarshal Kustomization struct code 2022-12-13 21:04:50 +00:00
Katrina Verey
14947e449b Address new linter complaints 2022-03-31 11:37:26 -04:00
Natasha Sarkar
b0636459dd Revert "[fix] configMapGenerator: extra space in end of line gives "\n" instead of line breaks" 2022-01-12 09:30:41 -08:00
natasha41575
a3d547ccd3 fix issue with multiline configmap data with extra space 2021-12-03 15:28:22 -08:00
natasha41575
c4a8a99834 add regression tests for multiline configmap with space 2021-12-03 15:12:21 -08:00
natasha41575
ba051c863b fix issue with quote being dropped in configmap generation 2021-10-14 18:30:28 -07:00
natasha41575
4d59146e48 test for dropped quote in configmap generation 2021-10-14 18:13:49 -07:00
monopole
839fd2b971 Remove branching on kyaml enablement 2021-03-09 14:29:27 -08:00
monopole
a8b851f84a Reinstate configmap/secret generator env field. 2021-03-07 20:42:41 -08:00
Natasha Sarkar
60bd8d15d9 upgraded to yaml.v2 v2.4.0 2021-03-02 18:04:21 -08:00
Natasha Sarkar
8b082aff5a Change paths for krusty tests to relative, and have top level be '.' instead of 'app' 2021-02-24 16:23:45 -08:00
Donny Xia
6518393f5d support binaryData merge 2021-02-11 15:34:16 -08:00
monopole
45b1bf17d3 Annotate decisions on issue 3304 in api. 2021-01-16 08:08:52 -08:00
monopole
b41df2293b Add another test covering fix of 3412 2021-01-14 11:32:34 -08:00
monopole
1edf9b630c Update configmap test with quotes fixed. 2021-01-14 11:01:37 -08:00
monopole
bb41d018b5 Add more tests and explain some strange quotes. 2021-01-13 15:49:12 -08:00
Donny Xia
378eaedc82 keep \n in the end of resource yaml 2021-01-08 15:36:36 -08:00
jregan
c113c41c9c Regression coverage for configmap generation. 2020-12-28 09:53:34 -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
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
c32a809dbd Fix formatting nit with enableKyaml 2020-12-17 11:21:46 -08:00
Donny Xia
083dccfe91 Update hash result in tests 2020-08-05 11:59:13 -07:00
jregan
436dada184 Upgrade to gopkg.in/yaml.v2 v2.3.0 2020-06-30 17:45:43 -07:00
Jeffrey Regan
382c330f5b Consolidate test harness to one package. 2019-12-02 12:29:10 -08:00
Dingshujie
9942a9278f mv configmaps_test to api/krusty/, Provide another high level example. 2019-11-30 09:34:01 +08:00