Skip to content

Commit

Permalink
close gzip writer before uploading volumesnapshots file
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kriss <[email protected]>
  • Loading branch information
skriss committed Oct 17, 2018
1 parent da9ed38 commit 35bb533
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ func persistBackup(backup *pkgbackup.Request, backupContents, backupLog *os.File
if err := json.NewEncoder(gzw).Encode(backup.VolumeSnapshots); err != nil {
errs = append(errs, errors.Wrap(err, "error encoding list of volume snapshots"))
}
if err := gzw.Close(); err != nil {
errs = append(errs, errors.Wrap(err, "error closing gzip writer"))
}

if len(errs) > 0 {
// Don't upload the JSON files or backup tarball if encoding to json fails.
Expand Down

0 comments on commit 35bb533

Please sign in to comment.