From 4dd1bb6f31f0653ce08b1fe341721a65c59d8521 Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Wed, 20 Sep 2023 15:07:18 +0200 Subject: [PATCH] internal/outofband/bmc: catch TaskNotFound after BMC reboot --- internal/outofband/bmc.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/outofband/bmc.go b/internal/outofband/bmc.go index f1d06523..f7fdd198 100644 --- a/internal/outofband/bmc.go +++ b/internal/outofband/bmc.go @@ -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" @@ -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) { + return model.StatusInstallComplete, nil + } + return model.StatusInstallUnknown, errors.Wrap(ErrBMCQuery, err.Error()) }