Support Kafka schema registry config#847
Conversation
|
@jiangpengcheng:Thanks for your contribution. For this PR, do we need to update docs? |
freeznet
left a comment
There was a problem hiding this comment.
Thanks for adding first-class Schema Registry support. The overall shape looks good: types + deepcopy + CRDs are consistent, the OAuth2 mount reuses the existing generateVolumeFromOAuth2Config helpers (volume name = secretName-secretKey, so a broker/SR shared secret collapses to one volume mounted at two paths — correct), and the webhook validation + unit tests are solid.
A couple of things worth confirming before merge (details inline):
- Basic-auth
${ENV}interpolation insideproducer_config— this is the first place the operator embeds${...}placeholders into the_kafka_config.producer_configJSON rather than into a shell command, so it depends on the generic runtime expanding env vars in producer config values. Worth confirming. - Minor: the OAuth2 sub-fields aren't validated in the webhook (relies on CRD
requiredmarkers) — confirming that's intentional.
Nits (non-blocking): schema.registry.oauth2.config always serializes "scope":"" when scope is unset (consistent with the existing broker OAuth2 mapping, so fine); the PR carries the doc-info-missing label — user-facing docs for the new schemaRegistry fields should follow; and the Go 1.25.11 -> 1.25.12 bump is unrelated housekeeping bundled in here.
Summary
schemaRegistrysection under Kafka messaging config for generic functions_kafka_config.producer_configfor the generic runtimeDetails
The generic runtime expects Schema Registry settings in Kafka producer config using the
schema.registry.*keys. This change lets users configure those settings with first-class Function Mesh fields instead of embedding them manually in producer config. Basic auth credentials are sourced from a Kubernetes secret, and OAuth2 credentials are mounted separately from the Kafka broker OAuth2 mount path.Testing
go test -count=1 ./controllers/spec ./pkg/webhookgit diff --check