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

References to deleting managed resources blocks deletion. #74

Closed
negz opened this issue Nov 4, 2019 · 1 comment · Fixed by #75
Closed

References to deleting managed resources blocks deletion. #74

negz opened this issue Nov 4, 2019 · 1 comment · Fixed by #75
Labels
bug Something isn't working

Comments

@negz
Copy link
Member

negz commented Nov 4, 2019

What happened?

In #66 we updated the managed resource reconciler such that managed resources resolve their references on every reconcile. We resolve our references before we observe, create, update, or delete the external resource that corresponds to our managed resource. This is because:

  1. We must resolve references before we observe the external resource, e.g. for resources like connection.servicenetworking.gcp.crossplane.io that may need its .spec.networkRef set in order to observe the external resource.
  2. We must observe the external resource in order to know whether we need to create, update, or delete it.

Cross resource resolution returns an error and does not proceed when the managed resource under reconciliation is dependent upon a resource that does not exist, or does not have condition Ready=True. This means that when, for example:

  • A Subnetwork references a Network.
  • A Network cannot be deleted until all of its Subnetworks have been deleted.
  • A Subnetwork cannot be deleted when its Network is deleting.

We end up stuck. The Subnetwork can't be deleted because the Network (managed resource) is deleting, and the Network can't be deleted because the Subnetwork (external resource) hasn't been deleted.

How can we reproduce it?

  1. Create GCP Network managed resource.
  2. Create a GCP Subnetwork managed resource that references said Network.
  3. Delete the Network resource.
  4. Delete the Subnetwork resource.

Observe that neither resource ever successfully deletes.

What environment did it happen in?

Crossplane version:

@negz negz added the bug Something isn't working label Nov 4, 2019
@negz
Copy link
Member Author

negz commented Nov 4, 2019

Some potential options to fix this are:

  • Return to the previous behaviour, in which we only attempt to resolve references until the first time we resolve all references successfully.
  • Don't resolve references when we're deleting.
  • Ignore errors resolving references when we're deleting.
  • Ignore errors resolving references at any point in our lifecycle, and rely instead of eventual consistency.

One thing to consider here is that some resources (again, specifically connection.servicenetworking.gcp.crossplane.io) may need references to be resolved in order to delete their external resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant