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

add oc adm prune role command to replace the existing reaper #19619

Merged
merged 2 commits into from
May 10, 2018

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 3, 2018

oc adm prune role accepts input like oc delete does, but does not remove the role itself. It removes the bindings.

If we follow this pattern, I would anticipate doing the same for future ones like oc adm prune user.

I think I prefer something like oc reap <resource string>. It works better with the "normal" command flow of doing generic things and it makes for an easy transition since you just oc reap <whatever flags>, then oc delete <whatever flags>.

@liggitt You asked for it this way. How about oc reap instead?

callers to `oc delete` that are deleting users, groups, roles, or cluster roles should first call `oc adm prune auth` with the resources.  That will remove deps before deletion.  `oc delete` will no longer clean up dependent resources in a future release.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 3, 2018
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 3, 2018
@deads2k
Copy link
Contributor Author

deads2k commented May 3, 2018

We spoke. We'll move toward oc adm prune auth <resource string> that ignores unknowns and reaps what it knows without deleting the objects themselves.

@enj
Copy link
Contributor

enj commented May 4, 2018

@deads2k remind me why we are moving away from reapers / why we cannot use GC for this?

This deletes bindings that reference a role correct?

@openshift/sig-security

@liggitt
Copy link
Contributor

liggitt commented May 4, 2018

why we are moving away from reapers

reapers started upstream as a client-side substitute for GC, and did whole-object dependent removal. they are being replaced upstream by server-side GC.

why we cannot use GC for this?

we made use of the reaper hook to do partial update of dependent objects. GC cannot reach into referencing objects and modify them arbitrarily

@enj
Copy link
Contributor

enj commented May 4, 2018

we made use of the reaper hook to do partial update of dependent objects. GC cannot reach into referencing objects and modify them arbitrarily

Right, but does something prevent us from setting ownerReferences in new role bindings? That way if you delete a role all the role bindings get GCed?

@deads2k
Copy link
Contributor Author

deads2k commented May 4, 2018

Right, but does something prevent us from setting ownerReferences in new role bindings? That way if you delete a role all the role bindings get GCed?

A possibly reasonable improvement that could be made upstream for this. Since GC expanded for cluster scoped resources, for cluster scoped ones too. How it gets added isn't obvious and it changes how manifests are handled for cluster-admins.

For users and groups it won't work. This doesn't expand our surface area and doesn't preclude future improvements, but does protect us from upstream developments.

@deads2k
Copy link
Contributor Author

deads2k commented May 7, 2018

/retest

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

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 size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 7, 2018
@deads2k
Copy link
Contributor Author

deads2k commented May 7, 2018

/assign @soltysh

We'll want this to provide a transition for people using delete on these resources. Check the release not and find the write spot to update in the docs.

@soltysh
Copy link
Contributor

soltysh commented May 8, 2018

@deads2k the idea is legit, but I'd really see the new pruners follow the patterns from the old ones, rather than using the reapers one. I'm worried that this might lead to others copying the wrong approach. Can be done as a followup, I can pick it up if you want me to.

@deads2k
Copy link
Contributor Author

deads2k commented May 8, 2018

@deads2k the idea is legit, but I'd really see the new pruners follow the patterns from the old ones, rather than using the reapers one. I'm worried that this might lead to others copying the wrong approach. Can be done as a followup, I can pick it up if you want me to

I don't understand what you mean. I don't think we'll end up with more of these, hence the non-generic name. The CLI contract is backwards from a "normal" pruner.

@deads2k
Copy link
Contributor Author

deads2k commented May 8, 2018

/retest

@deads2k
Copy link
Contributor Author

deads2k commented May 8, 2018

Spoke on a voice call. A refactor can wait until after the 1.11 rebase to avoid extra constraints

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Yup to what David said above.

/lgtm

@soltysh
Copy link
Contributor

soltysh commented May 9, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 9, 2018
@deads2k
Copy link
Contributor Author

deads2k commented May 9, 2018

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@deads2k
Copy link
Contributor Author

deads2k commented May 9, 2018

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 74a6a14 into openshift:master May 10, 2018
@deads2k deads2k deleted the cli-33-prune branch July 3, 2018 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. sig/security size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants