Skip to content

Add --kafka-cluster flag to usm connect register + update connect describe output for cloud Kafka - #3449

Open
Arman Garg (FlamedHunter) wants to merge 5 commits into
mainfrom
argarg-usm-cli-changes
Open

Add --kafka-cluster flag to usm connect register + update connect describe output for cloud Kafka#3449
Arman Garg (FlamedHunter) wants to merge 5 commits into
mainfrom
argarg-usm-cli-changes

Conversation

@FlamedHunter

@FlamedHunter Arman Garg (FlamedHunter) commented Aug 17, 2026

Copy link
Copy Markdown

Release Notes

Breaking Changes

  • Update output field name from confluent_platform_kafka_cluster_id to kafka_cluster_id

New Features

  • Add a new --kafka-cluster flag to confluent 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

  • PLACEHOLDER

Checklist

  • I have successfully built and used a custom CLI binary, without linter issues from this PR.
  • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.
  • I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.
  • I have verified this PR in Confluent Platform on-premises environment, if applicable.
  • I have attached manual CLI verification results or screenshots in the Test & Review section below.
  • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.
  • I confirm that this PR introduces no breaking changes or backward compatibility issues.
  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.
  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:
    • Confluent Cloud prod
    • Confluent Cloud stag
    • Confluent Platform
    • Check this box if the feature is enabled for certain organizations only

What

  • Add a new --kafka-cluster flag to confluent 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.
  • The two flags are mutually exclusive, and exactly one is required.
  • Registrations print a new, simplified response (a single "Kafka Cluster" field) for Cloud Kafka cluster (lkc-*)
  • No backend/API contract change — both flags populate the same kafka_cluster_id field on the existing usm/v1/connect-clusters create request.
  • Updated output field for usm connect describe, usm connect register and usm connect list from confluent_platform_kafka_cluster_id to kafka_cluster_id
  • Updated corresponding .golden test files as well

Blast Radius

  • Connect cluster registration for USM (Hybrid connect) usm connect register
  • Connect cluster list for USM usm connect list
  • Connect cluster describe for USM usm connect describe

References

Test & Review

usm connect describe

For on-prem Kafka cluster

./confluent usm connect describe usmcc-stgcz8imyipg2vp9gpx43a12maah4jbk -o json
{
  "id": "usmcc-stgcz8imyipg2vp9gpx43a12maah4jbk",
  "confluent_platform_connect_cluster": "nagarwal-setu-20260720-42e023d2-98b6-4b08-b162-47c2a90cb5df-main-connect",
  "kafka_cluster_id": "1-JdNMBgSOSE6fMbo4Iisw",
  "usm_kafka_cluster_id": "usmkc-stgc6i54lx834jovdeaqmjvadfp4av7v",
  "environment": "env-stgcn37oy6",
  "cloud": "AWS",
  "region": "us-west-2"
}

For cloud Kafka cluster

./confluent usm connect describe usmcc-stgcim7ibjf8ajbnrgp191nfk4jkgn6 -o json

{
  "id": "usmcc-stgcim7ibjf8ajbnrgp191nfk4jkgn6",
  "confluent_platform_connect_cluster": "connect-cc-cluster",
  "kafka_cluster_id": "lkc-stgcd2x0k1",
  "usm_kafka_cluster_id": "lkc-stgcd2x0k1",
  "environment": "env-stgcn37oy6",
  "cloud": "AWS",
  "region": "us-west-2"
}

usm connect list

[
  {
    "id": "usmcc-stgcim7ibjf8ajbnrgp191nfk4jkgn6",
    "confluent_platform_connect_cluster": "connect-cc-cluster",
    "kafka_cluster_id": "lkc-stgcd2x0k1",
    "usm_kafka_cluster_id": "lkc-stgcd2x0k1",
    "environment": "env-stgcn37oy6",
    "cloud": "AWS",
    "region": "us-west-2"
  },
  {
    "id": "usmcc-stgcirxeujji1h5sa6p6ha17pwj4p7il",
    "confluent_platform_connect_cluster": "nagarwal-setu-20260623-769ab951-3adb-4945-ab7d-da5f832b20a3-main-connect",
    "kafka_cluster_id": "Dqpx_9FERuKIFuq3Q5cn3w",
    "usm_kafka_cluster_id": "usmkc-stgcgfoiwnxh665e2497i86n4u9fsy7",
    "environment": "env-stgcn37oy6",
    "cloud": "AWS",
    "region": "us-west-2"
  }
]

usm connect register

for on-prem Kafka cluster

./confluent usm connect register argarg-setu-20260809-11f7f8c9-029e-4239-9f12-1ae0ff6a6a29-main-connect \
    --kafka-cluster JaH5VfLdRxi_CXfrA_jHxw \
    --cloud aws --region us-west-2
+--------------------------------+------------------------------------------------------------------------+
| ID                             | usmcc-stgc38nvbhwvae3vjyzsok018313v5rf                                 |
| Confluent Platform Connect     | argarg-setu-20260809-11f7f8c9-029e-4239-9f12-1ae0ff6a6a29-main-connect |
| Cluster                        |                                                                        |
| Kafka Cluster Id               | JaH5VfLdRxi_CXfrA_jHxw                                                 |
| USM Kafka Cluster Id           | usmkc-stgcppuy2f6x8q1dbkskllrgzlt84bb                                  |
| Environment                    | env-stgcn37oy6                                                         |
| Cloud                          | AWS                                                                    |
| Region                         | us-west-2                                                              |
+--------------------------------+------------------------------------------------------------------------+

for cloud Kafka cluster

./confluent usm connect register connect-cc-cluster \
    --kafka-cluster lkc-stgcqoxq3p \
    --cloud aws --region us-west-2
+--------------------------------+----------------------------------------+
| ID                             | usmcc-stgciraq6wzx8ydad5p4pjjnwaifb367 |
| Confluent Platform Connect     | connect-cc-cluster                     |
| Cluster                        |                                        |
| Kafka Cluster Id               | lkc-stgcqoxq3p                         |
| USM Kafka Cluster Id           | lkc-stgcqoxq3p                         |
| Environment                    | env-stgcnqgrj3                         |
| Cloud                          | AWS                                    |
| Region                         | us-west-2                              |
+--------------------------------+----------------------------------------+

usm connect deregister (not changed)

./confluent usm connect deregister usmcc-stgc8aq12lv354p6uf0klhrzx2vwrzm6
Are you sure you want to deregister USM Connect cluster "usmcc-stgc8aq12lv354p6uf0klhrzx2vwrzm6"? (y/n): y
Deregistered USM Connect cluster "usmcc-stgc8aq12lv354p6uf0klhrzx2vwrzm6".

@FlamedHunter
Arman Garg (FlamedHunter) requested a review from a team as a code owner August 17, 2026 06:40
Copilot AI lite review requested due to automatic review settings August 17, 2026 06:40
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copilot AI left a comment

Copy link
Copy Markdown

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 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-cluster flag for confluent usm connect-cluster create (alias register) and enforce “exactly one of” validation with the existing Confluent Platform Kafka cluster flag.
  • Route connect-cluster create/describe through 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.

Comment thread test/fixtures/output/usm/connect-cluster/create/create-cloud-kafka.golden Outdated
Comment thread internal/usm/command_connect_cluster_create.go
Comment thread internal/usm/command_connect_cluster_describe.go
Comment thread test/usm_connect_cluster_test.go
Comment thread internal/usm/command_connect_cluster_describe.go
Comment thread internal/usm/command_connect_cluster_cloud.go Outdated
Comment thread test/fixtures/output/usm/connect-cluster/create/create-cloud-kafka-json.golden Outdated
func printConnectClusterByType(cmd *cobra.Command, connectCluster usmv1.UsmV1ConnectCluster) error {
if !isCloudKafkaCluster(connectCluster.GetKafkaClusterId()) {
return printConnectCluster(cmd, connectCluster)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sonarqube-confluent

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants