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

e2e: wait for all nop resource deleted before deleting prerequisites #4819

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

turkenh
Copy link
Member

@turkenh turkenh commented Oct 16, 2023

Description of your changes

We observe weird, behaviors with the GC when we delete the types (XRD, CRD or MRs) before children of those (MRs) are cleaned up properly.

This PR attempts to fix these by waiting until no composed resource is left before deleting the prerequisites, typically the manifest under setup dir.

I have:

  • Read and followed Crossplane's contribution process.
  • Added or updated unit and E2E tests for my change.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, if necessary.
  • Opened a PR updating the docs, if necessary.

@turkenh turkenh closed this Oct 17, 2023
@turkenh turkenh reopened this Oct 17, 2023
@turkenh turkenh force-pushed the wait-for-it branch 4 times, most recently from dd1c95f to 68914d0 Compare October 17, 2023 09:32
@turkenh turkenh marked this pull request as ready for review October 17, 2023 09:33
@turkenh turkenh requested review from a team as code owners October 17, 2023 09:33
Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

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

given that we repeat the following block so many times:

WithTeardown("DeletePrerequisites", funcs.AllOf(
  funcs.ListedResourcesDeletedWithin(2*time.Minute, nopList),
  funcs.DeleteResources(manifests, "setup/*.yaml"),
  funcs.ResourcesDeletedWithin(3*time.Minute, manifests, "setup/*.yaml"),
)).

perhaps would be nice to improve readability by wrapping them into funcs.DeletePrerequisites function and get something like:

WithTeardown("DeletePrerequisites", funcs.DeletePrerequisites(manifest, "setup/*.yaml))

Signed-off-by: Hasan Turken <turkenh@gmail.com>
@turkenh
Copy link
Member Author

turkenh commented Oct 17, 2023

perhaps would be nice to improve readability by wrapping them into funcs.DeletePrerequisites function

Good point @pedjak, done!

@turkenh turkenh merged commit d8aff50 into crossplane:master Oct 17, 2023
16 checks passed
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.

None yet

2 participants