Skip to content

Commit

Permalink
internal/outofband/bmc: catch TaskNotFound after BMC reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Sep 20, 2023
1 parent a0d40b4 commit 4dd1bb6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/outofband/bmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

bmclibv2 "github.com/bmc-toolbox/bmclib/v2"
bmclibv2consts "github.com/bmc-toolbox/bmclib/v2/constants"
bmclibv2errs "github.com/bmc-toolbox/bmclib/v2/errors"

"github.com/bmc-toolbox/common"
"github.com/metal-toolbox/flasher/internal/model"
Expand Down Expand Up @@ -220,6 +221,11 @@ func (b *bmc) FirmwareInstallStatus(ctx context.Context, installVersion, compone

status, err := b.client.FirmwareInstallStatus(ctx, installVersion, componentSlug, bmcTaskID)
if err != nil {
// If BMC has rebooted, task won't be found, we assume success (failure don't reboot)
if componentSlug == "bmc" && err.Is(bmclibv2errs.ErrTaskNotFound) {

Check failure on line 225 in internal/outofband/bmc.go

View workflow job for this annotation

GitHub Actions / lint-test

err.Is undefined (type error has no field or method Is)) (typecheck)

Check failure on line 225 in internal/outofband/bmc.go

View workflow job for this annotation

GitHub Actions / lint-test

err.Is undefined (type error has no field or method Is) (typecheck)

Check failure on line 225 in internal/outofband/bmc.go

View workflow job for this annotation

GitHub Actions / lint-test

err.Is undefined (type error has no field or method Is)) (typecheck)

Check failure on line 225 in internal/outofband/bmc.go

View workflow job for this annotation

GitHub Actions / lint-test

err.Is undefined (type error has no field or method Is)) (typecheck)

Check failure on line 225 in internal/outofband/bmc.go

View workflow job for this annotation

GitHub Actions / lint-test

err.Is undefined (type error has no field or method Is) (typecheck)

Check failure on line 225 in internal/outofband/bmc.go

View workflow job for this annotation

GitHub Actions / lint-test

err.Is undefined (type error has no field or method Is)) (typecheck)
return model.StatusInstallComplete, nil
}

return model.StatusInstallUnknown, errors.Wrap(ErrBMCQuery, err.Error())
}

Expand Down

0 comments on commit 4dd1bb6

Please sign in to comment.