-
Notifications
You must be signed in to change notification settings - Fork 132
Add support for Orphan management policy #864
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
base: main
Are you sure you want to change the base?
Conversation
Fixes #6694 Signed-off-by: Bob Haddleton <[email protected]>
Signed-off-by: Jared Watts <[email protected]>
build: remove release-1.18 from Renovate baseBranches
Signed-off-by: Mangirdas Judeikis <[email protected]>
Fix npe in reconciler
Fixes #6694 Signed-off-by: Bob Haddleton <[email protected]>
…ne-runtime into add_orphan_policy
Signed-off-by: Bob Haddleton <[email protected]>
jbw976
left a comment
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.
This looks like a nice convenience policy that streamlines the experience for enabling the orphaning of resources. Thanks @bobh66! just a couple questions
| // PLEASE UPDATE THIS WHEN RELEASING. | ||
| "baseBranches": [ | ||
| 'main', | ||
| 'release-1.18', |
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.
this was already done in #865, so it's odd to see here again 🤔
| }, | ||
| want: want{delete: false}, | ||
| }, | ||
| "DeletionDeleteManagementActionOrphan": { |
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.
what do you think about another test case for TestShouldDelete too? e.g. make sure deletion is not allowed when this new orphan policy is set?
|
IMO the idea of management policies is that we define primitives like Observe, Create, Update, Delete that clearly state what will be done with the resources. I intentionally didnt put LateInitialize here as its a bit of an outlier and in hindsight should have been a separate feature outside of management policies. Adding more policies when we can do the same with the existing ones seems the move in the wrong direction. IMO it would just complicate things more. As its not a primitive, but a policy like If we really need a simplifier for management policies, maybe we should introduce a separate field: So you could just set |
|
@lsviben I don't disagree that adding |
Description of your changes
Added an Orphan management policy value which maps to ['Observe', 'Create', 'Update', 'LateInitialize'] in order to simplify the migration from
deletionPolicytomanagementPoliciesand facilitate controlled orphaning of resources.Fixes #6694 (Crossplane)
Tested using provider-kubernetes running a private branch of crossplane-runtime. Created an
Objectcontaining aSecretwith themanagementPolicies: ['Orphan']and verified that when theObjectwas deleted theSecretremained.Docs PR is crossplane/docs#993
Fixes crossplane/crossplane#6694
I have:
earthly +reviewableto ensure this PR is ready for review.- [ ] Addedbackport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.