Fix yaml in generator examples.

This commit is contained in:
Jeffrey Regan
2019-05-28 18:21:07 -07:00
parent 02e4f7305d
commit a7a2589e81
5 changed files with 48 additions and 46 deletions

View File

@@ -31,24 +31,26 @@ namePrefix: blah-
configMapGenerator:
- name: bob
literals:
- fruit=apple
- vegetable=broccoli
env: foo.env
- fruit=apple
- vegetable=broccoli
envs:
- foo.env
files:
- passphrase=phrase.dat
- forces.txt
- passphrase=phrase.dat
- forces.txt
- name: json
literals:
- 'v2=[{"path": "var/druid/segment-cache"}]'
- 'v2=[{"path": "var/druid/segment-cache"}]'
secretGenerator:
- name: bob
literals:
- fruit=apple
- vegetable=broccoli
env: foo.env
- fruit=apple
- vegetable=broccoli
envs:
- foo.env
files:
- passphrase=phrase.dat
- forces.txt
- passphrase=phrase.dat
- forces.txt
`)
th.WriteF("/app/foo.env", `
MOUNTAIN=everest
@@ -122,15 +124,15 @@ configMapGenerator:
- name: bob
behavior: create
literals:
- bean=pinto
- star=wolf-rayet
- bean=pinto
- star=wolf-rayet
literals:
- fruit=apple
- vegetable=broccoli
- fruit=apple
- vegetable=broccoli
files:
- forces.txt
- forces.txt
files:
- nobles=nobility.txt
- nobles=nobility.txt
`)
th.WriteF("/app/forces.txt", `
gravitational
@@ -177,7 +179,7 @@ configMapGenerator:
- name: com1
behavior: create
literals:
- from=base
- from=base
`)
th.WriteK("/app/base2", `
namePrefix: p2-
@@ -185,7 +187,7 @@ configMapGenerator:
- name: com2
behavior: create
literals:
- from=base
- from=base
`)
th.WriteK("/app/overlay/o1", `
bases:
@@ -194,7 +196,7 @@ configMapGenerator:
- name: com1
behavior: merge
literals:
- from=overlay
- from=overlay
`)
th.WriteK("/app/overlay/o2", `
bases:
@@ -203,7 +205,7 @@ configMapGenerator:
- name: com2
behavior: merge
literals:
- from=overlay
- from=overlay
`)
th.WriteK("/app/overlay", `
bases:
@@ -213,8 +215,8 @@ configMapGenerator:
- name: com1
behavior: merge
literals:
- foo=bar
- baz=qux
- foo=bar
- baz=qux
`)
m, err := th.MakeKustTarget().MakeCustomizedResMap()
if err != nil {

View File

@@ -178,14 +178,14 @@ resources:
- deployment.yaml
- service.yaml
configMapGenerator:
- name: configmap-in-base
literals:
- foo=bar
- name: configmap-in-base
literals:
- foo=bar
secretGenerator:
- name: secret-in-base
literals:
- username=admin
- password=somepw
- username=admin
- password=somepw
`)
th.WriteF("/app/deployment.yaml", `
apiVersion: apps/v1beta2
@@ -354,18 +354,18 @@ patchesStrategicMerge:
bases:
- ../app
configMapGenerator:
- name: configmap-in-overlay
literals:
- hello=world
- name: configmap-in-base
behavior: replace
literals:
- foo=override-bar
- name: configmap-in-overlay
literals:
- hello=world
- name: configmap-in-base
behavior: replace
literals:
- foo=override-bar
secretGenerator:
- name: secret-in-base
behavior: merge
literals:
- proxy=haproxy
- proxy=haproxy
`)
m, err := th.MakeKustTarget().MakeCustomizedResMap()
if err != nil {

View File

@@ -38,9 +38,9 @@ resources:
- deployment.yaml
- service.yaml
configMapGenerator:
- name: configmap-in-base
literals:
- foo=bar
- name: configmap-in-base
literals:
- foo=bar
`)
th.WriteF("/app/base/deployment.yaml", `
apiVersion: apps/v1beta2
@@ -93,9 +93,9 @@ patchesStrategicMerge:
bases:
- ../../base
configMapGenerator:
- name: configmap-in-overlay
literals:
- hello=world
- name: configmap-in-overlay
literals:
- hello=world
`)
}

View File

@@ -42,10 +42,10 @@ secretGenerator:
- name: the-non-default-namespace-secret
namespace: non-default
literals:
- password.txt=verySecret
- password.txt=verySecret
- name: the-secret
literals:
- password.txt=anotherSecret
- password.txt=anotherSecret
`)
m, err := th.MakeKustTarget().MakeCustomizedResMap()
if err != nil {

View File

@@ -32,8 +32,8 @@ resources:
configMapGenerator:
- name: test-config-map
literals:
- foo=bar
- baz=qux
- foo=bar
- baz=qux
vars:
- name: CDB_PUBLIC_SVC
objref: