Skip to content

Commit 35bb533

Browse files
committed
close gzip writer before uploading volumesnapshots file
Signed-off-by: Steve Kriss <steve@heptio.com>
1 parent da9ed38 commit 35bb533

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/backup_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ func persistBackup(backup *pkgbackup.Request, backupContents, backupLog *os.File
440440
if err := json.NewEncoder(gzw).Encode(backup.VolumeSnapshots); err != nil {
441441
errs = append(errs, errors.Wrap(err, "error encoding list of volume snapshots"))
442442
}
443+
if err := gzw.Close(); err != nil {
444+
errs = append(errs, errors.Wrap(err, "error closing gzip writer"))
445+
}
443446

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

0 commit comments

Comments
 (0)