Enable jsonpath transformers in application

This commit is contained in:
Jingfang Liu
2018-09-06 14:02:30 -07:00
parent 548ea8a9fb
commit 8810027d89
3 changed files with 22 additions and 4 deletions

View File

@@ -54,6 +54,13 @@ secretGenerator:
DB_USERNAME: "printf admin"
DB_PASSWORD: "printf somepw"
type: Opaque
patchesJson6902:
- target:
group: apps
version: v1
kind: Deployment
name: dply1
path: jsonpatch.json
`
kustomizationContent2 = `
secretGenerator:
@@ -73,6 +80,9 @@ kind: Namespace
metadata:
name: ns1
`
jsonpatchContent = `[
{"op": "add", "path": "/spec/replica", "value": "3"}
]`
)
func makeLoader1(t *testing.T) loader.Loader {
@@ -89,6 +99,10 @@ func makeLoader1(t *testing.T) loader.Loader {
if err != nil {
t.Fatalf("Failed to setup fake ldr.")
}
err = ldr.AddFile("/testpath/jsonpatch.json", []byte(jsonpatchContent))
if err != nil {
t.Fatalf("Failed to setup fake ldr.")
}
return ldr
}
@@ -114,6 +128,7 @@ func TestResources1(t *testing.T) {
},
},
"spec": map[string]interface{}{
"replica": "3",
"selector": map[string]interface{}{
"matchLabels": map[string]interface{}{
"app": "nginx",