-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Stateful Resource Reconciler #320
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
Conversation
|
@freeznet:Thanks for your contribution. For this PR, do we need to update docs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a stateful reconciliation framework for managing Pulsar resource state, with new tests added to validate permission state annotations and multi-permission handling.
- Introduces a BaseStatefulReconciler and its interfaces for generic state tracking
- Enhances PulsarPermission reconciliation with context change detection and state annotation updates
- Adds comprehensive test cases to verify correct permission operations and state transitions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/operator/resources_test.go | Added test cases for initial state, role modifications, and multi-permission scenarios |
| pkg/reconciler/stateful_reconciler.go | Introduced a generic framework for stateful resource reconciliation using annotations |
| pkg/connection/reconcile_permission.go | Updated PulsarPermission reconciliation with context change detection and improved state tracking |
Comments suppressed due to low confidence (1)
pkg/connection/reconcile_permission.go:181
- The variable 'currentPermissions' is used to determine slice capacity and in the iteration below but is not defined in this scope. Consider replacing it with the appropriate source of current roles (for example, using permission.Spec.Roles) to ensure the intended logic is applied.
currentRoles := make([]string, 0, len(currentPermissions))
maxsxu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Creative work! two questions here:
- what if the annotations been modified externally or lost?
- we need take care that annotation has max value size limitation
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #310
(or if this PR is one task of a github issue, please add
Master Issue: #<xyz>to link to the master issue.)Master Issue: #
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)