Skip to content

feat: cleanup done exec / debug CR after graceperiod#200

Open
Tom Bojer (tombojer) wants to merge 2 commits into
mainfrom
cr-cleanup
Open

feat: cleanup done exec / debug CR after graceperiod#200
Tom Bojer (tombojer) wants to merge 2 commits into
mainfrom
cr-cleanup

Conversation

@tombojer
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automatic cleanup of successful (done) StoreExec and StoreDebugInstance custom resources after a configurable grace period, exposed via operator config and Helm values. This helps reduce CR noise/accumulation while allowing operators time to inspect completed resources.

Changes:

  • Add CleanupGracePeriod support to StoreExecReconciler and StoreDebugInstanceReconciler, deleting successful one-shot CRs after the grace period (with requeue scheduling when not yet due).
  • Expose grace period as SUCCESSFUL_CR_CLEANUP_GRACE_PERIOD (config + Helm) with default 1h and allow disabling via 0.
  • Add unit tests covering cleanup eligibility, deletion timing, and disabled behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/controller/successful_cleanup_test.go New tests for successful-CR cleanup behavior (StoreExec + StoreDebugInstance).
internal/controller/storeexec_controller.go Adds grace-period-based cleanup for successful StoreExec CRs.
internal/controller/storedebuginstance_controller.go Adds grace-period-based cleanup for successful StoreDebugInstance CRs.
internal/config/config.go Adds SuccessfulCRCleanupGracePeriod to operator config/env parsing.
helm/values.yaml Adds Helm value for cleanup grace period with docs.
helm/templates/deployment.yaml Wires Helm value into env var SUCCESSFUL_CR_CLEANUP_GRACE_PERIOD.
cmd/main.go Passes configured grace period into both reconcilers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/controller/storeexec_controller.go
Comment thread internal/controller/storeexec_controller.go Outdated
Comment thread internal/controller/storedebuginstance_controller.go
@tombojer Tom Bojer (tombojer) self-assigned this May 19, 2026
@tombojer Tom Bojer (tombojer) marked this pull request as ready for review May 19, 2026 09:38
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.

Delete StoreExec CR after grace period

2 participants