Skip to content

Commit

Permalink
Improve OCI Runtime error
Browse files Browse the repository at this point in the history
ErrOCIRuntimeNotFound error is misleading. Try to make it more
understandable to the user that the OCI Runtime IE crun or runc is not
missing, but the command they attempted to run within the container is
missing.

[NO TESTS NEEDED] Regular tests should handle this.

Fixes: containers#10432

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed May 22, 2021
1 parent 490915c commit 4c095aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libpod/define/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var (

// ErrOCIRuntimeNotFound indicates the OCI runtime attempted to invoke a command
// that was not found
ErrOCIRuntimeNotFound = errors.New("OCI not found")
ErrOCIRuntimeNotFound = errors.New("OCI runtime attempted to invoke a command that was not found")

// ErrOCIRuntimeUnavailable indicates that the OCI runtime associated to a container
// could not be found in the configuration
Expand Down
2 changes: 1 addition & 1 deletion test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ load helpers
# ...but check the configured runtime engine, and switch to crun as needed
run_podman info --format '{{ .Host.OCIRuntime.Path }}'
if expr "$output" : ".*/crun"; then
err_no_such_cmd="Error: executable file.* not found in \$PATH: No such file or directory: OCI not found"
err_no_such_cmd="Error: executable file.* not found in \$PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found"
err_no_exec_dir="Error: open executable: Operation not permitted: OCI permission denied"
fi

Expand Down

0 comments on commit 4c095aa

Please sign in to comment.