From 5361360fad6cf8be663b09b30335254e4e492cdb Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Fri, 10 Nov 2023 14:36:24 +0100 Subject: [PATCH] Seek before upload --- providers/asrockrack/firmware.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/asrockrack/firmware.go b/providers/asrockrack/firmware.go index c367b98e..6b23e72f 100644 --- a/providers/asrockrack/firmware.go +++ b/providers/asrockrack/firmware.go @@ -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) + } + 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 {