mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-24 00:21:46 +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))
|
decoder := k8syaml.NewYAMLOrJSONDecoder(bytes.NewBuffer(data), len(data))
|
||||||
// check for kustomization in yaml with the same name and namespace
|
// check for kustomization in yaml with the same name and namespace
|
||||||
for {
|
for {
|
||||||
|
// ensure the target struct is emptied before decoding
|
||||||
|
k = &kustomizev1.Kustomization{}
|
||||||
err = decoder.Decode(k)
|
err = decoder.Decode(k)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue