-
Notifications
You must be signed in to change notification settings - Fork 20
CONFLUENT: Add link ID to link list output #3245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this 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
Idfield to thelinkOutstruct 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.
|
chernyih
left a comment
There was a problem hiding this 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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thank you.




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
With the change the output looks like
Breaking Changes
No breaking changes
New Features
This adds the link ID to the link list output
Bug Fixes
No bug fixes
Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Blast Radius
References
Test & Review