-
Notifications
You must be signed in to change notification settings - Fork 28
support function with replace sink and source #823
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 adds support for source and sink connectors in Pulsar functions, enabling functions to use external connectors (e.g., Kafka, Kinesis) as inputs/outputs instead of traditional Pulsar topics. It also adds configurability for Java instance runtime parameters.
Key changes:
- Added
SourceConnectorSpecandSinkConnectorSpectypes with fields for connector configuration including className, configs, and type information - Extended validation logic to skip input/output topic validation when connectors are configured
- Added logic to inject connector configuration into function specs and command-line arguments
- Added
instancePathandentryClassfields to JavaRuntime for runtime customization
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| api/compute/v1alpha1/function_types.go | Defines new SourceConnectorSpec and SinkConnectorSpec types |
| api/compute/v1alpha1/common.go | Adds InstancePath and EntryClass fields to JavaRuntime |
| controllers/spec/utils.go | Implements connector config extraction and application logic |
| controllers/spec/function.go | Updates function command generation to include connector directory |
| controllers/spec/source.go, sink.go | Updates source/sink command generation with instance path/entry class |
| controllers/spec/common.go | Updates MakeJavaFunctionCommand signature with connector directory and instance parameters |
| pkg/webhook/validate.go | Adds skip flags to validateInputOutput for connector scenarios |
| pkg/webhook/function_webhook.go | Sets skip flags based on connector presence |
| pkg/webhook/source_webhook.go, sink_webhook.go | Updates validation calls with skip flags |
| config/crd/bases/*.yaml | Updates CRD schemas with new fields |
| manifests/*.yaml | Regenerated manifests with new CRD schemas |
| controllers/spec/utils_test.go, function_test.go | Adds test coverage for connector functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
(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)