-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Enhance PulsarNamespace with schema management capabilities #323
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
feat: Enhance PulsarNamespace with schema management capabilities #323
Conversation
- Added SchemaCompatibilityStrategy and SchemaValidationEnforced fields to PulsarNamespaceSpec for better schema evolution control. - Updated CRD and documentation to reflect new schema management options. - Modified reconciliation logic to handle schema validation enforcement. - Adjusted deep copy methods to accommodate new fields.
|
@freeznet:Thanks for your contribution. For this PR, do we need to update docs? |
Co-authored-by: Copilot <[email protected]>
|
requires apache/pulsar-client-go#1386 to fix the misuse between SchemaCompatibilityStrategy and SchemaAutoUpdateCompatibilityStrategy |
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 extends PulsarNamespace with schema management by adding compatibility strategy and validation enforcement options across CRD, API types, reconciliation logic, admin client, and documentation.
- Introduces
schemaCompatibilityStrategyandschemaValidationEnforcedfields in the spec, CRD, docs, and deep-copy logic. - Updates reconciliation (
ReconcileNamespace) and admin client (ApplyNamespace,applyNamespacePolicies) to handle the new fields. - Bumps dependencies and refreshes generated code to accommodate new imports and deep-copy adjustments.
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/connection/reconcile_namespace.go | Maps new schema fields from the spec into the namespace payload. |
| pkg/admin/interface.go | Adds new fields to NamespaceParams. |
| pkg/admin/impl.go | Applies schema settings when creating/updating namespaces. |
| api/v1alpha1/pulsarnamespace_types.go | Defines new spec fields with validation tags. |
| api/v1alpha1/zz_generated.deepcopy.go | Implements deep-copy for new fields and fixes duration imports. |
| config/crd/bases/resource...pulsarnamespaces.yaml | Adds CRD entries for schema fields. |
| docs/pulsar_namespace.md | Documents usage and examples for schema management. |
| go.mod | Updates various module versions (including Pulsar client). |
Comments suppressed due to low confidence (2)
pkg/admin/interface.go:59
- [nitpick] The alias
utils2for the Pulsar admin utils package is unclear. Use a more descriptive alias (e.g.,adminutils) to improve readability and consistency.
SchemaCompatibilityStrategy *utils2.SchemaCompatibilityStrategy
pkg/admin/impl.go:507
- New schema enforcement logic should be covered by unit or integration tests to verify both enabled and disabled scenarios. Add tests for
SetSchemaValidationEnforcedandSetSchemaCompatibilityStrategypaths.
if params.SchemaValidationEnforced != nil {
| params.Bundles = ptr.To(int32(4)) | ||
| } | ||
|
|
||
| err := p.adminClient.Namespaces().CreateNsWithPolices(name, utils.Policies{ |
Copilot
AI
Jul 3, 2025
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.
The initial CreateNsWithPolices call no longer includes default schema settings, so new namespaces will always use cluster defaults. Consider passing SchemaCompatibilityStrategy and SchemaValidationEnforced in the create call to align behavior with updates.
* feat: Enhance PulsarNamespace with schema management capabilities - Added SchemaCompatibilityStrategy and SchemaValidationEnforced fields to PulsarNamespaceSpec for better schema evolution control. - Updated CRD and documentation to reflect new schema management options. - Modified reconciliation logic to handle schema validation enforcement. - Adjusted deep copy methods to accommodate new fields. * fix update policy * Update pkg/admin/impl.go Co-authored-by: Copilot <[email protected]> * ping to fix pr * go mod tidy * revert * fix dep --------- Co-authored-by: Copilot <[email protected]>
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #322 #321
(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
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)