Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Make udisksctl call non-fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
mangelajo committed Oct 24, 2023
1 parent 97887c6 commit 1702a0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/drivers/jumpstarter-board/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

mapset "github.com/deckarep/golang-set/v2"
"github.com/fatih/color"
)

const BASE_DISKSBYID = "/dev/disk/by-id/"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1702a0c

Please sign in to comment.