mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Sink: Force JSON encoding for .json files
This commit is contained in:
@@ -26,7 +26,7 @@ func TestByteWriter(t *testing.T) {
|
||||
|
||||
testCases := []testCase{
|
||||
//
|
||||
//
|
||||
// Test Case
|
||||
//
|
||||
{
|
||||
name: "wrap_resource_list",
|
||||
@@ -60,7 +60,7 @@ functionConfig:
|
||||
},
|
||||
|
||||
//
|
||||
//
|
||||
// Test Case
|
||||
//
|
||||
{
|
||||
name: "multiple_items",
|
||||
@@ -189,6 +189,32 @@ metadata:
|
||||
config.kubernetes.io/path: "a/b/a_test.yaml"
|
||||
`,
|
||||
},
|
||||
|
||||
//
|
||||
// Test Case
|
||||
//
|
||||
{
|
||||
name: "encode_valid_json",
|
||||
items: []string{
|
||||
`{
|
||||
"a": "a long string that would certainly see a newline introduced by the YAML marshaller abcd123",
|
||||
"metadata": {
|
||||
"annotations": {
|
||||
"config.kubernetes.io/path": "test.json"
|
||||
}
|
||||
}
|
||||
}`,
|
||||
},
|
||||
|
||||
expectedOutput: `{
|
||||
"a": "a long string that would certainly see a newline introduced by the YAML marshaller abcd123",
|
||||
"metadata": {
|
||||
"annotations": {
|
||||
"config.kubernetes.io/path": "test.json"
|
||||
}
|
||||
}
|
||||
}`,
|
||||
},
|
||||
}
|
||||
|
||||
for i := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user