Skip to content

Commit

Permalink
Seek before upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Nov 10, 2023
1 parent 5821518 commit 5361360
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions providers/asrockrack/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f
mybytes, err = io.ReadAll(reader)
fmt.Printf("ReadAll reader before uploadFW len:%d\n", len(mybytes))

if file, ok := reader.(*os.File); ok {
fmt.Printf("Seek before upload\n")
file.Seek(0, 0)

Check failure on line 114 in providers/asrockrack/firmware.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `file.Seek` is not checked (errcheck)
}

a.log.V(2).WithValues("step", "2/4").Info("upload BMC firmware image to " + fwEndpoint)
err = a.uploadFirmware(ctx, fwEndpoint, reader, fileSize)
if err != nil {
Expand Down

0 comments on commit 5361360

Please sign in to comment.