Skip to content

Commit

Permalink
Merge branch 'main' into switch-state-scheduling-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeefreak101 committed Nov 27, 2023
2 parents 300aa47 + b565dd4 commit 2b502c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions providers/asrockrack/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ func (a *ASRockRack) firmwareUpdateStatus(ctx context.Context, component string,

switch installStatus {
case versionStrMatch:
if progress == nil {
// TODO: we should pass the force parameter to firmwareUpdateStatus,
// so that we can know if we expect a version change or not
a.log.V(3).Info("Nil progress + no version change -> unknown")
return constants.FirmwareInstallUnknown, nil
}

return constants.FirmwareInstallComplete, nil
case versionStrEmpty:
return constants.FirmwareInstallUnknown, nil
Expand Down
5 changes: 5 additions & 0 deletions providers/asrockrack/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ func (a *ASRockRack) uploadFirmware(ctx context.Context, endpoint string, fwRead
fieldName, fileName := "fwimage", "image"
contentLength := multipartSize(fieldName, fileName) + fileSize

// Before reading the file, rewind to the beginning
if file, ok := fwReader.(*os.File); ok {
_, _ = file.Seek(0, 0)
}

// setup pipe
pipeReader, pipeWriter := io.Pipe()
defer pipeReader.Close()
Expand Down

0 comments on commit 2b502c9

Please sign in to comment.