Skip to content

Return errors instead of log.Fatal in storage/adapter.go - #15

Open
magic-peach wants to merge 1 commit into
urunc-dev:mainfrom
magic-peach:fix/10-storage-adapter-no-fatal
Open

Return errors instead of log.Fatal in storage/adapter.go#15
magic-peach wants to merge 1 commit into
urunc-dev:mainfrom
magic-peach:fix/10-storage-adapter-no-fatal

Conversation

@magic-peach

Copy link
Copy Markdown

Description

Part of #10. Covers internal/runtime/storage/adapter.go: replaces its 6 log.Fatal calls (in Prepare/CreateTask/StartTask/DeleteTask) with wrapped errors -- same reasoning as the other three PRs in this series.

Issues Resolved

Updates #10 (last of four small PRs against this issue, one per file)

Testing

go build, go vet, gofmt -l, go test ./... all clean.

log.Fatal calls os.Exit(1) directly, which kills the whole harness
process on a single trial's containerd error instead of letting the
orchestrator record the trial as failed and move on to the next one.

Every log.Fatal call here lives inside Prepare, CreateTask, StartTask,
or DeleteTask, which already return (harnessruntime.StageResult,
error) to satisfy the Adapter interface, so no caller changes were
needed: each fatal call is replaced with returning the underlying
error wrapped with fmt.Errorf, matching the error-wrapping style
already used elsewhere in this file (getOrPullImage).

Updates urunc-dev#10

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant