mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-08 00:37:27 +00:00
Reset target struct before decoding
Signed-off-by: Marcel Boehm <marcel.boehm@inovex.de>
This commit is contained in:
parent
72a2866508
commit
8cb7188919
1 changed files with 2 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue