Add test for reading multiple Kustomizations in a single file

Signed-off-by: Marcel Boehm <marcel.boehm@inovex.de>
pull/5302/head
Marcel Boehm 4 days ago
parent 912718103c
commit 72a2866508

@ -226,6 +226,16 @@ func Test_unMarshallKustomization(t *testing.T) {
}
})
}
t.Run("correct parsing of multiple documents", func(t *testing.T) {
b.kustomizationFile = "testdata/local-kustomization/multi-doc-reset.yaml"
ks, err := b.unMarshallKustomization()
if err != nil {
t.Errorf("unexpected err '%s'", err)
}
if len(ks.Spec.Components) > 0 {
t.Errorf("previous Kustomization in file leaked into subsequent Kustomizations")
}
})
}
func Test_ResolveKustomization(t *testing.T) {

@ -0,0 +1,18 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: first
namespace: flux-system
spec:
path: "./k8s/first"
components:
- foo
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
namespace: flux-system
spec:
path: "./k8s/second"
---
Loading…
Cancel
Save