Skip to content

Commit

Permalink
providers/redfish/firmware: removed firmwareUpdateCompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Sep 14, 2023
1 parent b85640e commit 4dec4c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
24 changes: 1 addition & 23 deletions providers/redfish/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (c *Conn) multipartHTTPUpload(ctx context.Context, url, applyAt string, upd
// payload ordered in the format it ends up in the multipart form
payload := &multipartPayload{
updateParameters: []byte(parameters),
updateFile: update,
updateFile: update,
}

return c.runRequestWithMultipartPayload(url, payload)
Expand Down Expand Up @@ -227,28 +227,6 @@ func (c *Conn) firmwareInstallMethodURI(ctx context.Context) (method installMeth
return "", "", errors.Wrap(bmclibErrs.ErrRedfishUpdateService, "unsupported update method")
}

// firmwareUpdateCompatible retuns an error if the firmware update process for the BMC is not supported
func (c *Conn) firmwareUpdateCompatible(ctx context.Context) (err error) {
updateService, err := c.redfishwrapper.UpdateService()
if err != nil {
return err
}

// TODO: check for redfish version

// update service disabled
if !updateService.ServiceEnabled {
return errors.Wrap(bmclibErrs.ErrRedfishUpdateService, "service disabled")
}

// for now we expect multipart HTTP push update support
if updateService.MultipartHTTPPushURI == "" {
return errors.Wrap(bmclibErrs.ErrRedfishUpdateService, "Multipart HTTP push updates not supported")
}

return nil
}

// pipeReaderFakeSeeker wraps the io.PipeReader and implements the io.Seeker interface
// to meet the API requirements for the Gofish client https://github.com/stmcginnis/gofish/blob/46b1b33645ed1802727dc4df28f5d3c3da722b15/client.go#L434
//
Expand Down
7 changes: 0 additions & 7 deletions providers/redfish/firmware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,6 @@ func TestMultipartPayloadSize(t *testing.T) {
}
}

func TestFirmwareUpdateCompatible(t *testing.T) {
err := mockClient.firmwareUpdateCompatible(context.TODO())
if err != nil {
t.Fatal(err)
}
}

// referenced in main_test.go
func openbmcStatus(w http.ResponseWriter, r *http.Request) {

Expand Down

0 comments on commit 4dec4c6

Please sign in to comment.