Skip to content

Commit 453f2da

Browse files
committed
Make sure the event struct is cleared for each new event
Otherwise if an `omitempty` field may retain the value of the previous event. Signed-off-by: Jan Dubois <[email protected]>
1 parent 722b7d1 commit 453f2da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/guestagent/api/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ func (c *client) Events(ctx context.Context, onEvent func(api.Event)) error {
7171
return err
7272
}
7373
defer resp.Body.Close()
74-
var ev api.Event
7574
dec := json.NewDecoder(resp.Body)
7675
for {
76+
var ev api.Event
7777
if err := dec.Decode(&ev); err != nil {
7878
return err
7979
}

0 commit comments

Comments
 (0)