-
Notifications
You must be signed in to change notification settings - Fork 21
fix: align namespace and topic policies operation #363
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 aligns namespace and topic policy operations by introducing explicit backlog quota type support and improving validation for backlog quota configurations. The changes add stricter validation requirements and enhance policy management capabilities for both namespaces and topics.
Key changes:
- Adds
BacklogQuotaTypefield to topic and namespace specs with enum validation (destination_storage, message_age) - Refactors backlog quota handling into a shared
buildBacklogQuotafunction with improved validation - Adds support for managing persistence policies, inactive topic policies, subscription expiration time, and namespace properties in namespace reconciliation
- Increases operator memory limits to accommodate enhanced policy management
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/spec.go | Updates test helper functions to explicitly set backlog quota retention policy and type |
| tests/operator/resources_test.go | Adds comprehensive tests for subscription expiration time, backlog quota validation, and clearing various policies |
| pkg/connection/reconcile_topic.go | Adds BacklogQuotaType parameter to topic creation and logging |
| pkg/admin/interface.go | Adds BacklogQuotaType field to TopicParams struct |
| pkg/admin/impl.go | Refactors backlog quota logic into shared buildBacklogQuota function, adds handlers for persistence policies, inactive topic policies, subscription expiration, and properties |
| docs/pulsar_topic.md | Updates documentation to indicate backlogQuotaRetentionPolicy is conditional (required when limits are set) |
| docs/pulsar_namespace.md | Updates documentation with conditional requirement and adds example with backlogQuotaRetentionPolicy |
| config/manager/manager.yaml | Increases memory limits from 128Mi to 512Mi and requests from 64Mi to 128Mi |
| config/default/manager_auth_proxy_patch.yaml | Increases memory limits and requests to match manager.yaml |
| config/crd/bases/resource.streamnative.io_pulsartopics.yaml | Adds enum validations for backlogQuotaRetentionPolicy and backlogQuotaType fields |
| config/crd/bases/resource.streamnative.io_pulsarnamespaces.yaml | Adds enum validations for backlogQuotaRetentionPolicy field |
| charts/pulsar-resources-operator/crds/resource.streamnative.io_pulsartopics.yaml | Adds enum validations matching the base CRD |
| charts/pulsar-resources-operator/crds/resource.streamnative.io_pulsarnamespaces.yaml | Adds enum validations matching the base CRD |
| api/v1alpha1/zz_generated.deepcopy.go | Adds generated DeepCopy code for BacklogQuotaType field |
| api/v1alpha1/pulsartopic_types.go | Adds BacklogQuotaType field with enum validation to PulsarTopicSpec |
| api/v1alpha1/pulsarnamespace_types.go | Adds enum validation kubebuilder marker to BacklogQuotaRetentionPolicy field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #
(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)