From 1702a0c508c14a1757c014a9f9ad44112b3737bb Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Date: Tue, 24 Oct 2023 14:05:18 +0200 Subject: [PATCH] Make udisksctl call non-fatal --- pkg/drivers/jumpstarter-board/storage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/drivers/jumpstarter-board/storage.go b/pkg/drivers/jumpstarter-board/storage.go index 25cc52f..4a1fbd1 100644 --- a/pkg/drivers/jumpstarter-board/storage.go +++ b/pkg/drivers/jumpstarter-board/storage.go @@ -12,6 +12,7 @@ import ( "time" mapset "github.com/deckarep/golang-set/v2" + "github.com/fatih/color" ) const BASE_DISKSBYID = "/dev/disk/by-id/" @@ -233,7 +234,10 @@ func writeImageToDisk(imagePath string, diskPath string, offset uint64) error { var errb bytes.Buffer cmd.Stderr = &errb if err := cmd.Run(); err != nil { - return fmt.Errorf("writeImageToDisk: %w %s", err, errb.String()) + // udiskctl doesn't work in the container workflows, so we ignore the error and write a warning + color.Set(color.FgYellow) + fmt.Printf("warning: udisksctl power-off failed: %s\n", errb.String()) + color.Unset() } time.Sleep(WAIT_TIME_USB_STORAGE_OFF) return nil