Skip to content

Conversation

@andrewgrantcflt
Copy link
Member

@andrewgrantcflt andrewgrantcflt commented Dec 23, 2025

Release Notes

This PR adds link ID to the link list output. This is important for when we return unmanaged links in the output. Unmanaged links do not have a link name; in https://github.com/confluentinc/ce-kafka/pull/26802 we updated the server to make sure "" is returned for link name when the cluster is running in cloud. Instead these links just have the link ID. So we need to include the link ID otherwise the user has no way of identifying the link. Without this change the output looks like

root@toolbox-agrant:/confluent-8.0.0# confluent --cluster  lkc-devczopo2y kafka link list
  Name | Source Cluster | Destination Cluster | Remote Cluster |      State       | Error | Error Message  
-------+----------------+---------------------+----------------+------------------+-------+----------------
       |                |                     |                | UNMANAGED_SOURCE |       |  

With the change the output looks like

root@toolbox-agrant:/# ./dirty-confluent-linux-arm64  --cluster  lkc-devczopo2y kafka link list
  Name |           ID           | Source Cluster | Destination Cluster | Remote Cluster |      State       | Error | Error Message  
-------+------------------------+----------------+---------------------+----------------+------------------+-------+----------------
       | 2KQJhOPPTe6ulvY6RhCcfQ |                |                     |                | UNMANAGED_SOURCE |       |  

Breaking Changes
No breaking changes

New Features
This adds the link ID to the link list output

Bug Fixes
No bug fixes
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

Blast Radius

References

Test & Review

Copilot AI review requested due to automatic review settings December 23, 2025 15:06
@andrewgrantcflt andrewgrantcflt requested a review from a team as a code owner December 23, 2025 15:06
@confluent-cla-assistant
Copy link

🎉 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.

Copy link

Copilot AI left a 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 a link ID field to the Kafka cluster link list output across all supported output formats (plain text, JSON, YAML). The change enables users to identify links by their unique ID in addition to the link name.

Key Changes:

  • Added Id field to the linkOut struct with appropriate struct tags for serialization
  • Updated list field definitions to include "Id" alongside "Name" in both cloud and on-premises implementations
  • Enhanced test fixtures to validate the new ID field in all output formats

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/kafka/command_link_describe.go Added Id field to linkOut struct with omitempty tags for flexible serialization
internal/kafka/command_link_list.go Updated newLink() to populate link ID and added "Id" to list fields; modified cloud list field initialization
internal/kafka/command_link_create_onprem.go Updated on-premises list field initialization to include "Id"
test/test-server/kafka_rest_router.go Added test case with UNMANAGED_SOURCE state and LINKID6 to verify ID display for links without names
test/fixtures/output/kafka/link/list-link-yaml.golden Updated expected YAML output to include link_id field for all test links
test/fixtures/output/kafka/link/list-link-json.golden Updated expected JSON output to include link_id field for all test links
test/fixtures/output/kafka/link/list-link-plain.golden Updated expected plain text table output to include "ID" column with link IDs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqube-confluent
Copy link

Copy link
Member

@chernyih chernyih left a comment

Choose a reason for hiding this comment

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

@andrewgrantcflt Thanks for the fix. lgtm with a question.

}

return append(x, "DestinationCluster", "RemoteCluster")
return append(x, "DestinationCluster", "RemoteCluster", "State", "Error", "ErrorMessage")
Copy link
Member

Choose a reason for hiding this comment

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

Any reason there is a change here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for on-prem. I figured we ought to include the state otherwise for unmanaged links we'd just print the ID which doesn't seem very helpful. At that point I figured it wouldn't hurt to include the error and error message, at least to be consistent with cloud.

We could just include state if we wanted to make less changes here. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Thank you.

@andrewgrantcflt andrewgrantcflt enabled auto-merge (squash) December 23, 2025 21:33
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