Skip to content

Fix: setup.sh to delete resources properly #4718

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

Closed
wants to merge 2 commits into from

Conversation

chethanm99
Copy link
Contributor

Fix: Clean up cert-manager leases after E2E tests [Fixes #4712 ]

This PR addresses an issue where cert-manager related resources (specifically, leases) were not being properly cleaned up after running the end-to-end (E2E) tests.

The delete_cluster function in test/e2e/setup.sh was only deleting the Kind cluster itself, but not the resources deployed within the cluster, such as cert-manager's deployments and associated resources.

The delete_cluster function in test/e2e/setup.sh has been modified to explicitly delete the following resources before deleting the Kind cluster

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chethanm99
Once this PR has been reviewed and has the lgtm label, please assign camilamacedo86 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 30, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @chethanm99. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 30, 2025
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

I appreciate you taking the time to work on this. I just wanted to share some thoughts on the proposed change.

We should avoid making this change because we already have methods in place for uninstalling cert-manager and Prometheus. The delete-cluster command is currently designed to only delete the cluster itself, and it’s important to keep that behavior consistent.

Not all tests require cert-manager or Prometheus to be installed, so their uninstallation is managed individually by the tests that install them. By including their removal in delete-cluster, we might be introducing assumptions that don't apply to all cases.

Could you help me understand the motivation behind this change a bit more?

See the questions made in the issue for more context:
#4712 (comment)

/hold until we better understand the scenario, ( steps performed, what was expected. what was faced instead )

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 31, 2025
@chethanm99
Copy link
Contributor Author

chethanm99 commented Mar 31, 2025

Hi @camilamacedo86

Thanks for taking the time to reply. I was looking to resolve an issue that could improve user experience during which I stumbled upon this issue this looked like a good bug to be fixed.

After analyzing the discussion in #4712 I think the right decision is to leave the delete-cluster command as it is and apply changes after better understanding the situation. What's your opinion on that?

@camilamacedo86
Copy link
Member

Hi @chethanm99,

Thank you a lot for your contribution and to aiming to make the project better.

Please see the comment here:
#4712 (comment)

The changes in this PR do not address the scenario you're aiming to solve.
Additionally, as discussed above, we cannot change the delete cluster behavior.

So, I'm closing this PR as deferred.
That said, feel free to open a new PR proposing improvements to the uninstall method prose, if you believe that's helpful — we’d also need to update the internal utils used specifically for Kubebuilder’s tests.

I hope you don’t mind.
Closing this one for now, but feel free to re-open if needed.

@chethanm99 chethanm99 deleted the Kube1 branch March 31, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e tests leave resources behind after running
3 participants