Skip to content

Commit

Permalink
misc: handle unhandled errors
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Oct 10, 2023
1 parent bc55318 commit 278b017
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions internal/runner/post_renderer_kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ func writeToFile(fs filesys.FileSystem, path string, content []byte) error {
if err != nil {
return err
}
helmOutput.Write(content)
if err := helmOutput.Close(); err != nil {
if _, err = helmOutput.Write(content); err != nil {
return err
}
if err = helmOutput.Close(); err != nil {
return err
}
return nil
Expand All @@ -58,8 +60,10 @@ func writeFile(fs filesys.FileSystem, path string, content *bytes.Buffer) error
if err != nil {
return err
}
content.WriteTo(helmOutput)
if err := helmOutput.Close(); err != nil {
if _, err = content.WriteTo(helmOutput); err != nil {
return err
}
if err = helmOutput.Close(); err != nil {
return err
}
return nil
Expand Down

0 comments on commit 278b017

Please sign in to comment.