DGS-25000 Add exporter cluster-link config describe command - #3462
Open
tmalik (tmalikconfluent) wants to merge 1 commit into
Open
Conversation
Adds `confluent schema-registry exporter configuration cluster-link describe`,
which calls the new SR `GET /exporters/{name}/config/clusterlink` endpoint
(confluentinc/schema-registry-plugins#2134) to derive the Cluster Link
config(s) that replicate a schema exporter's subject/context translation.
There was a problem hiding this comment.
Pull request overview
Adds a new Schema Registry exporter subcommand to fetch and print the derived Cluster Link configuration for an exporter, backed by a new Schema Registry SDK endpoint, and validated via CLI integration tests + test-server wiring.
Changes:
- Add
confluent schema-registry exporter configuration cluster-link describe <name>command that callsGET /exporters/{name}/config/clusterlink. - Extend the Schema Registry client to call the new SDK method for the cluster-link config endpoint.
- Add test-server route/handler and CLI integration tests with JSON/YAML golden fixtures.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test-server/schema_registry_router.go | Adds a mock route for /exporters/{name}/config/clusterlink. |
| test/test-server/schema_registry_handlers.go | Adds a handler returning a representative derived Cluster Link config map. |
| test/schema_registry_test.go | Adds integration test cases for JSON/YAML output of the new command. |
| test/fixtures/output/schema-registry/exporter/configuration/cluster-link-describe-yaml.golden | Adds YAML golden output for the new command. |
| test/fixtures/output/schema-registry/exporter/configuration/cluster-link-describe-json.golden | Adds JSON golden output for the new command. |
| pkg/schemaregistry/client.go | Adds GetExporterClusterLinkConfig client wrapper method. |
| internal/schema-registry/command_exporter_configuration.go | Wires the new cluster-link subtree under exporter configuration. |
| internal/schema-registry/command_exporter_configuration_cluster_link.go | Introduces the cluster-link command group (needs Cloud gating). |
| internal/schema-registry/command_exporter_configuration_cluster_link_describe.go | Implements the describe command (currently exposes on-prem flags; should be Cloud-only). |
| go.mod | Bumps schema-registry-sdk-go to the referenced version with the new endpoint. |
| go.sum | Adds checksums for the bumped schema-registry-sdk-go version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+11
to
+30
| func (c *command) newExporterConfigurationClusterLinkDescribeCommand(cfg *config.Config) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "describe <name>", | ||
| Short: "Describe the schema exporter's Cluster Link config.", | ||
| Long: "Derive the Cluster Link config(s) that replicate a schema exporter's subject/context translation, so they don't have to be hand-copied.", | ||
| Args: cobra.ExactArgs(1), | ||
| RunE: c.exporterConfigurationClusterLinkDescribe, | ||
| } | ||
|
|
||
| pcmd.AddContextFlag(cmd, c.CLICommand) | ||
| if cfg.IsCloudLogin() { | ||
| pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand) | ||
| } else { | ||
| addCaLocationAndClientPathFlags(cmd) | ||
| } | ||
| addSchemaRegistryEndpointFlag(cmd) | ||
| pcmd.AddOutputFlagWithDefaultValue(cmd, output.JSON.String()) | ||
|
|
||
| return cmd | ||
| } |
Comment on lines
+3
to
+18
| import ( | ||
| "github.com/spf13/cobra" | ||
|
|
||
| "github.com/confluentinc/cli/v4/pkg/config" | ||
| ) | ||
|
|
||
| func (c *command) newExporterConfigurationClusterLinkCommand(cfg *config.Config) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "cluster-link", | ||
| Short: "Manage the schema exporter's Cluster Link config.", | ||
| } | ||
|
|
||
| cmd.AddCommand(c.newExporterConfigurationClusterLinkDescribeCommand(cfg)) | ||
|
|
||
| return cmd | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Notes
New Features
confluent schema-registry exporter configuration cluster-link describeto derive the Cluster Link config(s) that replicate a schema exporter's subject/context translation.Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Confluent Cloud only. Adds a new CLI command,
confluent schema-registry exporter configuration cluster-link describe <name>, which calls the new SR management endpointGET /exporters/{name}/config/clusterlink(confluentinc/schema-registry-plugins#2134) and prints the derived Cluster Link config(s) for that exporter, so they don't have to be hand-copied.Blast Radius
New, additive command under
schema-registry exporter configuration; no existing commands or behavior are changed.References
JIRA: DGS-25000
Backend: confluentinc/schema-registry-plugins#2134
SDK: schema-registry-sdk-go@v0.1.3-0.20260812213011-262e9f97627b
Test & Review
Added CLI integration test coverage (
test/schema_registry_test.go, JSON/YAML golden fixtures) and test-server route/handler for the new endpoint.