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

Print the correct underlying cause for OCI errors #7968

Merged
merged 1 commit into from
Oct 9, 2020
Merged

Print the correct underlying cause for OCI errors #7968

merged 1 commit into from
Oct 9, 2020

Conversation

xordspar0
Copy link
Contributor

Previously, the order of OCI error messages was reversed, so that the
type of error was listed as the cause. For example:

Error: writing file `cpu.cfs_quota_us`: Invalid argument: OCI runtime error

This error message makes it seem like "OCI runtime error" is the
argument that was invalid. In fact, "OCI runtime error" is the error and
"writing file ..." is the cause. With this change, the above message
reads:

Error: writing file `cpu.cfs_quota_us`: Invalid argument

Signed-off-by: Jordan Christiansen [email protected]

cmd/podman/root.go Outdated Show resolved Hide resolved
@xordspar0
Copy link
Contributor Author

@mheon @vrothberg PTAL

cmd/podman/root.go Outdated Show resolved Hide resolved
@TomSweeneyRedHat
Copy link
Member

@xordspar0 Any chance you could whip up a test to make sure the error message is formatted correctly going forward?

@rhatdan
Copy link
Member

rhatdan commented Oct 9, 2020

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan, xordspar0

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2020
@rhatdan
Copy link
Member

rhatdan commented Oct 9, 2020

LGTM

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

@vrothberg
Copy link
Member

@xordspar0 Any chance you could whip up a test to make sure the error message is formatted correctly going forward?

A test would be good. I guess a unit tests would be sufficient.

@xordspar0
Copy link
Contributor Author

Sure. For a unit test I'll need to break the logic out to a separate function that can take arguments. Maybe that's better anyway.

Previously, the order of OCI error messages was reversed, so that the
type of error was listed as the cause. For example:

    Error: writing file `cpu.cfs_quota_us`: Invalid argument: OCI runtime error

This error message makes it seem like "OCI runtime error" is the
argument that was invalid. In fact, "OCI runtime error" is the error and
"writing file ..." is the cause. With this change, the above message
reads:

    Error: OCI runtime error: writing file `cpu.cfs_quota_us`: Invalid argument

Signed-off-by: Jordan Christiansen <[email protected]>
@xordspar0
Copy link
Contributor Author

The tests are all passing. This should be good to merge. There's something wrong with Cirrus that makes it keep losing its connection with the agent nodes, but other than that everything is green.

@mheon
Copy link
Member

mheon commented Oct 9, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 9, 2020
@openshift-merge-robot openshift-merge-robot merged commit cec2403 into containers:master Oct 9, 2020
@xordspar0 xordspar0 deleted the oci-runtime-error branch October 9, 2020 19:25
@xordspar0
Copy link
Contributor Author

🎉 Thanks for the thoughtful reviews and suggestions, everyone!

@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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.

7 participants