mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 17:34:21 +00:00
Enable jsonpath transformers in application
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user