Skip to content

Commit

Permalink
do not clobber deferred file op errs in storage func
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Jan 7, 2025
1 parent 4a2e7dc commit a42598b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ func StorageTransfer(config *util.CloudConfig, snapshotPath string, cleanup bool
}
}()

// TODO: clobbers deferred err from snapshot close and remove
// upload snapshot to various storage backends
switch config.Platform {
case util.AWS:
return snapshotS3Upload(config.Container, snapshotFile, snapshotName)
err = snapshotS3Upload(config.Container, snapshotFile, snapshotName)
case util.GCP:
return snapshotCSUpload(config.Container, snapshotFile, snapshotName)
err = snapshotCSUpload(config.Container, snapshotFile, snapshotName)
default:
log.Printf("an invalid cloud platform was specified: %s", config.Platform)
return errors.New("invalid cloud platform")
err = errors.New("invalid cloud platform")
}

return err
}

0 comments on commit a42598b

Please sign in to comment.