Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oci: use json formatted errors from the runtime #3311

Merged
merged 2 commits into from
Jun 13, 2019

Conversation

giuseppe
Copy link
Member

request json formatted error messages from the OCI runtime so that we
can nicely print them.

Signed-off-by: Giuseppe Scrivano [email protected]

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S labels Jun 12, 2019
@giuseppe
Copy link
Member Author

it is would be safer though to do it only with runc, any idea that doesn't require to hard code the runtime name?

libpod/oci_linux.go Outdated Show resolved Hide resolved
libpod/oci_linux.go Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the oci-errors branch 2 times, most recently from 9b99096 to 0311c32 Compare June 12, 2019 20:47
libpod/oci_linux.go Outdated Show resolved Hide resolved
libpod/oci_linux.go Outdated Show resolved Hide resolved
libpod/oci_linux.go Outdated Show resolved Hide resolved
request json formatted error messages from the OCI runtime so that we
can nicely print them.

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe
Copy link
Member Author

I've addressed the comments, pushed a new version. I still think we should have a way to disable it somehow

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2019

@giuseppe Should we put something in the libpod.conf about how to call the OCI
oci flags or something like that?

@giuseppe
Copy link
Member Author

@giuseppe Should we put something in the libpod.conf about how to call the OCI
oci flags or something like that?

the problem I had is that the flag will be global while we allow multiple OCI runtimes to be specified, can the TOML conf file be extended to have such a structured data? Otherwise it won't really help when using different OCI runtimes, as you need to change the conf file every time.

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2019

I am fine with extending it.

if ss.si.Message != "" {
return errors.Wrapf(ErrInternal, "container create failed: %s", ss.si.Message)
return errors.Wrapf(ErrOCIRuntime, "%s", ss.si.Message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I like having the "container created failed:" in the message. Although I'd prefer it to be "container creation failed:".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one comment for consideration.

add a new configuration `runtime_supports_json` to list what OCI
runtimes support the --log-format=json option.  If the runtime is not
listed here, libpod will redirect stdout/stderr from the runtime
process.

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe
Copy link
Member Author

added a new patch so that we can configure what runtimes support the json format

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 13, 2019
@openshift-merge-robot openshift-merge-robot merged commit f628a97 into containers:master Jun 13, 2019
edsantiago added a commit to edsantiago/libpod that referenced this pull request Jun 17, 2019
I'm running the BATS tests manually once in a while, and
catching several problems each week that make it past
the rest of CI. Since the BATS tests run at RPM gating
time, we need to catch problems earlier. Try running
the tests from Cirrus.

Tests will be skipped on Ubuntu due to a too-ancient
version of coreutils (8.28; the 'timeout -v' we use
requires 8.29).

Tests are run *after* integration tests, even though
these take three minutes and would be nice to have
fail quickly, because running before causes bizarre
CI failures. Shrug.

UPDATE: also fix run test, broken by containers#3311.

Signed-off-by: Ed Santiago <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants