mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
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) {
|
func TestGeneratorIntVsStringWithMerge(t *testing.T) {
|
||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
th.WriteK("base", `
|
th.WriteK("base", `
|
||||||
@@ -72,8 +71,7 @@ configMapGenerator:
|
|||||||
literals:
|
literals:
|
||||||
- month=12
|
- month=12
|
||||||
`)
|
`)
|
||||||
opts := th.MakeDefaultOptions()
|
m := th.Run("overlay", th.MakeDefaultOptions())
|
||||||
m := th.Run("overlay", opts)
|
|
||||||
th.AssertActualEqualsExpected(m, `apiVersion: v1
|
th.AssertActualEqualsExpected(m, `apiVersion: v1
|
||||||
data:
|
data:
|
||||||
crisis: "true"
|
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
|
// Generate a Secret and a ConfigMap from the same data
|
||||||
// to compare the result.
|
// to compare the result.
|
||||||
func TestGeneratorBasics(t *testing.T) {
|
func TestGeneratorBasics(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user