Skip to content

bootstrap policy: replace panic with error - #15952

Closed
tiran wants to merge 1 commit into
openshift:masterfrom
tiran:policy_drop_panic
Closed

tiran wants to merge 1 commit into
openshift:masterfrom
tiran:policy_drop_panic

Conversation

@tiran

@tiran tiran commented Aug 24, 2017

Copy link
Copy Markdown
Contributor

Replace panic() call in ConvertToOriginClusterRolesOrDie() and
ConvertToOriginClusterRoleBindingsOrDie() with error return value.
Callers take care of proper error handling.

@openshift/sig-security

See: #15827
Signed-off-by: Christian Heimes [email protected]

Replace panic() call in ConvertToOriginClusterRolesOrDie() and
ConvertToOriginClusterRoleBindingsOrDie() with error return value.
Callers take care of proper error handling.

See: openshift#15827
Signed-off-by: Christian Heimes <[email protected]>
@tiran
tiran requested a review from enj August 24, 2017 10:50
@openshift-merge-robot openshift-merge-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 24, 2017
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tiran
We suggest the following additional approver: fabianofranz

Assign the PR to them by writing /assign @fabianofranz in a comment when ready.

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@deads2k

deads2k commented Aug 24, 2017

Copy link
Copy Markdown
Contributor

Rather than do this, how about we make everything use RBAC roles instead and eliminate the conversion entirely.

@tiran

tiran commented Aug 24, 2017

Copy link
Copy Markdown
Contributor Author

@deads2k Yes, that's the next step.

@deads2k

deads2k commented Aug 24, 2017

Copy link
Copy Markdown
Contributor

@deads2k Yes, that's the next step.

Guess I'm not sure why I'd take this step in the interim.

if err := kapi.Scheme.Convert(&in[i], newRole, nil); err != nil {
errs = append(errs, fmt.Errorf("error converting %q: %v", in[i].Name, err))
continue
return nil, fmt.Errorf("error converting %q: %v", in[i].Name, err)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not sure we should bail out on first error.seem like reporting all failures is a property that should be maintained

@tiran

tiran commented Aug 29, 2017

Copy link
Copy Markdown
Contributor Author

I'm closing my PR in favor of PR #16033. It removes the function ConvertToOriginClusterRolesOrDie and ConvertToOriginClusterRoleBindingsOrDie.

@tiran tiran closed this Aug 29, 2017
@tiran
tiran deleted the policy_drop_panic branch August 29, 2017 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants