mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-24 07:47:02 +00:00
Merge pull request #3461 from monopole/anotherTest
Add another test covering fix of 3412
This commit is contained in:
@@ -52,7 +52,6 @@ metadata:
|
||||
`)
|
||||
}
|
||||
|
||||
// Observation: Numbers no longer quoted
|
||||
func TestGeneratorIntVsStringWithMerge(t *testing.T) {
|
||||
th := kusttest_test.MakeHarness(t)
|
||||
th.WriteK("base", `
|
||||
@@ -72,8 +71,7 @@ configMapGenerator:
|
||||
literals:
|
||||
- month=12
|
||||
`)
|
||||
opts := th.MakeDefaultOptions()
|
||||
m := th.Run("overlay", opts)
|
||||
m := th.Run("overlay", th.MakeDefaultOptions())
|
||||
th.AssertActualEqualsExpected(m, `apiVersion: v1
|
||||
data:
|
||||
crisis: "true"
|
||||
@@ -86,6 +84,41 @@ metadata:
|
||||
`)
|
||||
}
|
||||
|
||||
func TestGeneratorFromProperties(t *testing.T) {
|
||||
th := kusttest_test.MakeHarness(t)
|
||||
th.WriteK("base", `
|
||||
configMapGenerator:
|
||||
- name: test-configmap
|
||||
behavior: create
|
||||
envs:
|
||||
- properties
|
||||
`)
|
||||
th.WriteF("base/properties", `
|
||||
VAR1=100
|
||||
`)
|
||||
th.WriteK("overlay", `
|
||||
resources:
|
||||
- ../base
|
||||
configMapGenerator:
|
||||
- name: test-configmap
|
||||
behavior: "merge"
|
||||
envs:
|
||||
- properties
|
||||
`)
|
||||
th.WriteF("overlay/properties", `
|
||||
VAR2=200
|
||||
`)
|
||||
m := th.Run("overlay", th.MakeDefaultOptions())
|
||||
th.AssertActualEqualsExpected(m, `apiVersion: v1
|
||||
data:
|
||||
VAR1: "100"
|
||||
VAR2: "200"
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: test-configmap-hdghb5ddkg
|
||||
`)
|
||||
}
|
||||
|
||||
// Generate a Secret and a ConfigMap from the same data
|
||||
// to compare the result.
|
||||
func TestGeneratorBasics(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user