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

Refactoring compositions without deleting/recreating composed resources #5654

Open
turkenh opened this issue May 7, 2024 · 0 comments
Open

Comments

@turkenh
Copy link
Member

turkenh commented May 7, 2024

What problem are you facing?

I have a composition that has multiple layers and I want to refactor it by moving some composed resources between layers, introducing new layers, or getting rid of some nested composites to have a more flattened structure.

See the following basic example:

Screenshot 2024-05-07 at 14 51 53

If I just do the refactoring and apply the new composition, ManagedResource/mr-b will be deleted by XNestedComposite/bar and be recreated by XComposite/foo, resulting in a data loss when my resource is a stateful one.

I cannot think of an easy way to achieve this other than the following manual / tedious steps:

  1. Create a new composition with different name/labels, e.g. xcomposite.v2.acme.com
  2. On the old composition, mark all MRs to deletionPolicy: Orphan
  3. After upgrading, use the new label to select the new composition with a controller for existing XRs. Old composites/MRs disappear without deleting any “external” resource, and newly composed MRs take ownership.

How could Crossplane help solve your problem?

Provide an easy way to do this kind of refactoring without causing the deletion of any external resources.

@turkenh turkenh added the enhancement New feature or request label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants