1
0
mirror of synced 2026-02-06 19:05:55 +00:00

Reset target struct before decoding

Signed-off-by: Marcel Boehm <marcel.boehm@inovex.de>
This commit is contained in:
Marcel Boehm
2025-04-15 11:37:16 +02:00
parent 72a2866508
commit 8cb7188919

View File

@@ -464,6 +464,8 @@ func (b *Builder) unMarshallKustomization() (*kustomizev1.Kustomization, error)
decoder := k8syaml.NewYAMLOrJSONDecoder(bytes.NewBuffer(data), len(data))
// check for kustomization in yaml with the same name and namespace
for {
// ensure the target struct is emptied before decoding
k = &kustomizev1.Kustomization{}
err = decoder.Decode(k)
if err != nil {
if err == io.EOF {