[UX-749] rpk: add --format json/yaml to shadow describe#29111
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds JSON and YAML output format support to the rpk shadow describe command. Previously, the command only supported text output with configurable sections. Now users can output the complete shadow link configuration in structured formats suitable for programmatic consumption or configuration management.
Key Changes:
- Added
shadowLinkDescriptionand related structs to represent the unified output format - Modified
printShadowLinkDescriptionandprintCloudShadowLinkDescriptionto support formatters - Implemented conversion functions to transform protobuf types into the output structs
- Added the
--formatflag to the command
c-julin
approved these changes
Dec 24, 2025
Contributor
Author
|
For the record, copilot review is mistaken, probably misguided as both core and cloud share some proto definitions. Go build would have failed if this was the case. |
Contributor
Author
|
/backport v25.3.x |
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.
It is pretty similar to our raw text response, the only difference is that the fields in the overview section are flattened now in the top level as it makes more sense when querying the resource.
Sample:
Pretty print:
{ "name": "shadow-test", "id": "f895a293-21bc-4c49-a1d4-501d3abde03e", "state": "ACTIVE", "client_options": { "client_id": "cluster-link-shadow-test-444-21bc-444-a1d4-444", "bootstrap_servers": [ "444.foo.bar.cloud.redpanda.com:9092" ], "tls_settings": { "enabled": true }, "authentication_configuration": { "username": "foo", "mechanism": "SCRAM-SHA-256", "password_set": true, "password_set_at": "2025-12-19T20:13:10Z" }, "metadata_max_age_ms": 10000, "connection_timeout_ms": 1000, "retry_backoff_ms": 100, "fetch_wait_max_ms": 500, "fetch_min_bytes": 5242880, "fetch_max_bytes": 20971520, "fetch_partition_max_bytes": 5242880 }, "topic_metadata_sync_options": { "interval": "30s", "paused": false, "start_offset": "EARLIEST", "auto_create_shadow_topic_filters": [ { "pattern_type": "PREFIX", "filter_type": "INCLUDE", "name": "shadow-" } ], "synced_shadow_topic_properties": [ "segment.ms", "retention.ms", "compression.type" ] }, "consumer_offset_sync_options": { "interval": "30s", "paused": false, "group_filters": [ { "pattern_type": "LITERAL", "filter_type": "INCLUDE", "name": "*" } ] }, "security_sync_options": { "interval": "30s", "paused": false, "acl_filters": [ { "resource_filter": { "resource_type": "TOPIC", "pattern_type": "PREFIXED", "name": "test-" }, "access_filter": { "principal": "User:admin", "operation": "ANY", "permission_type": "ALLOW", "host": "*" } } ] }, "schema_registry_sync_options": { "shadowing_mode": "shadow schema registry topic" } }Backports Required
Release Notes
Improvements