-
Notifications
You must be signed in to change notification settings - Fork 3
Add Opensearch resource cleanup on Store deletion via finalizer #163
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
Draft
Copilot
wants to merge
7
commits into
main
Choose a base branch
from
copilot/delete-opensearch-resources
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: tombojer <24324298+tombojer@users.noreply.github.com>
- Fix TLS certificate verification (always verify, don't skip) - Collect and return deletion errors for proper retry behavior - Improve error handling for partial failures during cleanup Co-authored-by: tombojer <24324298+tombojer@users.noreply.github.com>
- Extract index deletion logic into reusable helper function - Use errors.Join for cleaner error formatting - Reduce code duplication between regular and admin index cleanup Co-authored-by: tombojer <24324298+tombojer@users.noreply.github.com>
- Add clear documentation about TLS certificate verification - Explain how to configure custom CA certificates for production - Address code review feedback on security configuration Co-authored-by: tombojer <24324298+tombojer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Delete opensearch resources upon store deletion
Add Opensearch resource cleanup on Store deletion via finalizer
Dec 12, 2025
Contributor
|
@copilot Fix the golangci-lint issues and add tests |
- Update .golangci.yml to use new format compatible with v2.0 - Add integration test for full cleanup flow - Add test for partial failure scenarios - Improve test coverage from 52.8% to 86.5% Co-authored-by: tombojer <24324298+tombojer@users.noreply.github.com>
Author
Fixed in commit 6713396. Changes:
All tests passing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementation Complete: Opensearch Resource Cleanup on Store Deletion ✅
All tasks completed successfully!
Summary of Implementation
This PR adds automatic Opensearch resource cleanup when a Store is deleted, controlled by a custom field in the Store CRD using Kubernetes finalizers.
Changes Made
Store CRD Enhancement ✅
CleanupOnDeletionboolean field toOpensearchSpec(defaults to false)Opensearch Cleanup Package ✅
errors.Join()Finalizer Implementation ✅
shop.shopware.com/opensearch-cleanupfinalizerTesting & Quality ✅
Test Coverage
Configuration Example
How It Works
opensearch.enabledandopensearch.cleanupOnDeletionare both trueBenefits
Files Changed
.golangci.yml: Updated to v2.0 formatapi/v1/store.go: +3 linesapi/v1/zz_generated.deepcopy.go: +28 linesinternal/controller/store_controller.go: +50/-44 linesinternal/opensearch/cleanup.go: +222 linesinternal/opensearch/cleanup_test.go: +450 lines (10 tests)Total: ~750 insertions, 44 deletions
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.