-
Notifications
You must be signed in to change notification settings - Fork 62
[Bug] stale resource not cleaned up #2351
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
Labels
bug
Something isn't working
Comments
ash01ish
added a commit
to ash01ish/chainsaw
that referenced
this issue
Apr 17, 2025
…#2351 When a test exits unexpectedly after creating resources, those resources aren't cleaned up. When the test is run again, it detects the existing resources but returns an error instead of cleaning them up, leaving them stale indefinitely. This change modifies the tryCreateResource method to not return an error when a resource already exists, but instead continue with the operation. This ensures that pre-existing resources are properly cleaned up at the end of the test. Fixes kyverno#2351
ash01ish
added a commit
to ash01ish/chainsaw
that referenced
this issue
Apr 17, 2025
…#2351 When a test exits unexpectedly after creating resources, those resources aren't cleaned up. When the test is run again, it detects the existing resources but returns an error instead of cleaning them up, leaving them stale indefinitely. This change modifies the tryCreateResource method to not return an error when a resource already exists, but instead continue with the operation. This ensures that pre-existing resources are properly cleaned up at the end of the test. Fixes kyverno#2351 Signed-off-by: Ashish Thirunagari <[email protected]>
ash01ish
added a commit
to ash01ish/chainsaw
that referenced
this issue
Apr 21, 2025
…#2351 When a test exits unexpectedly after creating resources, those resources aren't cleaned up. When the test is run again, it detects the existing resources but returns an error instead of cleaning them up, leaving them stale indefinitely. This change modifies the tryCreateResource method to not return an error when a resource already exists, but instead continue with the operation. This ensures that pre-existing resources are properly cleaned up at the end of the test. Fixes kyverno#2351 Signed-off-by: Ashish Thirunagari <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
chainsaw version Version
v0.2.4
Description
We're running some repetitive tests that reuse the same resource name. Normally, the resource is cleaned up once the test completes.However if the test exits unexpectedly, the cleanup may not occur, leaving the resource behind. When this happens, subsequent test runs don't attempt to clean up the existing resource, resulting in it being left stale indefinitely.
I’m wondering if this is because the current cleanup logic only considers resources that were explicitly created during the test run.
Steps to reproduce
Expected behavior
All resources should be cleaned up after the test.
Screenshots
No response
Logs
Slack discussion
No response
Troubleshooting
The text was updated successfully, but these errors were encountered: