-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Properly handle errors in policy listing #15748
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
Conversation
In some policy{binding} function a conversion is performed after listing, but error checking is not properly performed on the previous listing function return. This can cause panics on errors. Fixes openshift#15747 Signed-off-by: Simo Sorce <simo@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should ToPolicyList
and the other casts also be updated to check for nil pointers? It looks like they may be used elsewhere
@pweil- I'm checking if there are other callers that may pass nil to them, but I do not think we should protect from nil within them. |
I do not see any other place where nil could be passed in. |
Looks good testing locally (had same problem, but everything worked correctly). /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: simo5, smarterclayton The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@simo5
|
@pweil- the contract in that interface is that you pass in a valid pointer, not nil, there is no other argument, so passing nil makes no sense anyway. I think it is better to catch misuse with a panic() in this specific case than papering it over by returning an error. |
/retest |
/test extended_conformance_gce |
@smarterclayton the extended_conformance_gce test failed twice, but I do not see any obvious cause. Looks like a flake, but I cannot find out if we have alredy seen this elsewhere ... |
/test extended_conformance_gce |
Might be a new flake introduced to master. But I don't see the pr history
for the last three merges causing flakes on their test runs. It might be
related to this code. Needs more investigation
On Aug 12, 2017, at 11:56 AM, OpenShift CI Robot <notifications@github.com> wrote:
@simo5 <https://github.com/simo5>: The following test *failed*, say /retest
to rerun them all:
Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_gce 719da77
<719da77>
link
<https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_extended_conformance_gce/5851>
/test
extended_conformance_gce
Full PR test history <https://openshift-gce-devel.appspot.com/pr/15748>. Your
PR dashboard <https://openshift-gce-devel.appspot.com/pr/simo5>. Please
help us cut down on flakes by linking to
<https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests>
an open issue
<https://github.com/openshift/origin/issues?q=is:issue+is:open> when you
hit one in your PR.
Instructions for interacting with me using PR comments are available here
<https://github.com/kubernetes/community/blob/master/contributors/devel/pull-requests.md>.
If you have questions or suggestions related to my behavior, please file an
issue against the kubernetes/test-infra
<https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:>
repository. I understand the commands that are listed here
<https://github.com/kubernetes/test-infra/blob/master/commands.md>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15748 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p71SsBcDA-OCMAziGiJKr06hCu18ks5sXcscgaJpZM4O1DN2>
.
|
Looks like broke in last nights batch merge. Definitely master is broken.
On Aug 12, 2017, at 11:56 AM, OpenShift CI Robot <notifications@github.com> wrote:
@simo5 <https://github.com/simo5>: The following test *failed*, say /retest
to rerun them all:
Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_gce 719da77
<719da77>
link
<https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_extended_conformance_gce/5851>
/test
extended_conformance_gce
Full PR test history <https://openshift-gce-devel.appspot.com/pr/15748>. Your
PR dashboard <https://openshift-gce-devel.appspot.com/pr/simo5>. Please
help us cut down on flakes by linking to
<https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests>
an open issue
<https://github.com/openshift/origin/issues?q=is:issue+is:open> when you
hit one in your PR.
Instructions for interacting with me using PR comments are available here
<https://github.com/kubernetes/community/blob/master/contributors/devel/pull-requests.md>.
If you have questions or suggestions related to my behavior, please file an
issue against the kubernetes/test-infra
<https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:>
repository. I understand the commands that are listed here
<https://github.com/kubernetes/test-infra/blob/master/commands.md>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15748 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p71SsBcDA-OCMAziGiJKr06hCu18ks5sXcscgaJpZM4O1DN2>
.
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 15657, 15748) |
@simo5: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
oh I didn't mean return an error here. I meant that converting a nil |
@pweil- that code is going away, normally I would open a followup ticket, but in this case I would just ignore. (RBAC is coming and all policy stuff is going to be dropped eventually) |
This probably needs a backport to 3.6... |
Automatic merge from submit-queue Properly handle errors in policy listing In some policy{binding} function a conversion is performed after listing, but error checking is not properly performed on the previous listing function return. This can cause panics on errors. Fixed for master, #15747 via #15748
In some policy{binding} function a conversion is performed after listing,
but error checking is not properly performed on the previous listing
function return.
This can cause panics on errors.
Fixes #15747