Add --kafka-cluster flag to usm connect register + update connect describe output for cloud Kafka - #3449
Add --kafka-cluster flag to usm connect register + update connect describe output for cloud Kafka#3449Arman Garg (FlamedHunter) wants to merge 5 commits into
--kafka-cluster flag to usm connect register + update connect describe output for cloud Kafka#3449Conversation
…output for cloud Kafka
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
This PR extends USM Connect cluster registration to support Confluent Cloud Kafka clusters via a new --kafka-cluster flag, and updates connect-cluster create/describe output to present cloud-backed Kafka cluster IDs more appropriately.
Changes:
- Add
--kafka-clusterflag forconfluent usm connect-cluster create(aliasregister) and enforce “exactly one of” validation with the existing Confluent Platform Kafka cluster flag. - Route
connect-cluster create/describethrough a type-aware printer to adjust output labeling for cloud-backed (lkc-...) Kafka cluster IDs. - Add/adjust integration test fixtures to cover the new flag behavior (success + validation failures).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/usm_connect_cluster_test.go | Adds integration coverage for cloud --kafka-cluster create path and validation errors. |
| test/fixtures/output/usm/connect-cluster/create/create-fail-mutually-exclusive-kafka-flags.golden | Golden for mutually-exclusive flags error/usage output. |
| test/fixtures/output/usm/connect-cluster/create/create-fail-missing-kafka-flag.golden | Golden for missing required flag-group error/usage output. |
| test/fixtures/output/usm/connect-cluster/create/create-cloud-kafka.golden | Golden for human output when metadata Kafka cluster is cloud (lkc-...). |
| test/fixtures/output/usm/connect-cluster/create/create-cloud-kafka-json.golden | Golden for JSON output when metadata Kafka cluster is cloud (lkc-...). |
| test/fixtures/output/usm/connect-cluster/create-help.golden | Updates help output to include the new flag. |
| internal/usm/command_connect_cluster_describe.go | Uses type-aware printing for describe. |
| internal/usm/command_connect_cluster_create.go | Adds the new flag and flag-group validation; uses type-aware printing for create. |
| internal/usm/command_connect_cluster_cloud.go | Introduces cloud-specific output shape + printer selection logic. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| func printConnectClusterByType(cmd *cobra.Command, connectCluster usmv1.UsmV1ConnectCluster) error { | ||
| if !isCloudKafkaCluster(connectCluster.GetKafkaClusterId()) { | ||
| return printConnectCluster(cmd, connectCluster) | ||
| } |
There was a problem hiding this comment.
I would recommend adding Kafka Cluster Id as a new field to the existing struct instead so that we can also display it on the list command output.
Then instead of branching on which output struct to use, we branch on which of the two fields to populate.
Other than that, lgtm.
|




Release Notes
Breaking Changes
confluent_platform_kafka_cluster_idtokafka_cluster_idNew Features
--kafka-clusterflag toconfluent unified-stream-manager connect register, accepting either a Confluent Platform Kafka cluster ID or a Confluent Cloud Kafka cluster ID (lkc-...), as an alternative to--confluent-platform-kafka-cluster.Bug Fixes
Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
--kafka-clusterflag toconfluent unified-stream-manager connect register, accepting either a Confluent Platform Kafka cluster ID or a Confluent Cloud Kafka cluster ID (lkc-...), as an alternative to--confluent-platform-kafka-cluster.lkc-*)kafka_cluster_idfield on the existingusm/v1/connect-clusterscreate request.usm connect describe,usm connect registerandusm connect listfromconfluent_platform_kafka_cluster_idtokafka_cluster_id.goldentest files as wellBlast Radius
usm connect registerusm connect listusm connect describeReferences
Test & Review
usm connect describe
For on-prem Kafka cluster
For cloud Kafka cluster
usm connect list
usm connect register
for on-prem Kafka cluster
for cloud Kafka cluster
usm connect deregister (not changed)