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

Skip error if role no longer exists in instance profile deletion #1719

Merged

Conversation

justinmir
Copy link

Description of your changes

When performing the PreDelete step on an InstanceProfile that detaches a role via RemoveRoleFromInstanceProfileWithContext it is possible that the role no longer exists. If so, the InstanceProfile can no longer be deleted succesfully, repeatedly failing the PreDelete step.

This ignores the error is NoSuchEntity is returned when detaching the role as the role not existing implies we should be able to proceed with the delete step for the instance profile.

Fixes #1713

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Use of fork in internal crossplane deployment, instance profiles no longer get stuck during teardown due to the role already being detached and deleted.

When performing the PreDelete step on an `InstanceProfile` that detaches
a role via `RemoveRoleFromInstanceProfileWithContext` it is
possible that the role no longer exists. If so, the `InstanceProfile`
can no longer be deleted succesfully, repeatedly failing the `PreDelete`
step.

This ignores the error is `NoSuchEntity` is returned when detaching the
role as the role not existing implies we should be able to proceed with
the delete step for the instancep profile.

Signed-off-by: justin.miron <[email protected]>
@justinmir justinmir force-pushed the fix-instance-profile-deletion branch from a8b9df2 to 9b616a1 Compare April 5, 2023 22:20
@haarchri haarchri merged commit 699f815 into crossplane-contrib:master Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InstanceProfile cannot be cleaned up if associated Role is deleted first
2 participants