Skip to content
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

rpk: add --format flag to rpk topic describe #24387

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

r-vasquez
Copy link
Contributor

@r-vasquez r-vasquez commented Nov 29, 2024

Continuation of https://github.com/redpanda-data/redpanda/pull/23418/files

This PR introduces the support of --format flag to rpk topic describe.

Example output:

$ rpk topic describe foo --format json
[{"summary":{"name":"foo","internal":false,"partitions":1,"replicas":1,"error":""},"configs":[{"key":"cleanup.policy","value":"delete","source":"DEFAULT_CONFIG"},{"key":"compression.type","value":"producer","source":"DEFAULT_CONFIG"},{"key":"delete.retention.ms","value":"-1","source":"DEFAULT_CONFIG"},{"key":"flush.bytes","value":"262144","source":"DEFAULT_CONFIG"},{"key":"flush.ms","value":"100","source":"DEFAULT_CONFIG"},{"key":"initial.retention.local.target.bytes","value":"-1","source":"DEFAULT_CONFIG"},{"key":"initial.retention.local.target.ms","value":"-1","source":"DEFAULT_CONFIG"},{"key":"max.message.bytes","value":"1048576","source":"DEFAULT_CONFIG"},{"key":"message.timestamp.type","value":"CreateTime","source":"DEFAULT_CONFIG"},{"key":"redpanda.iceberg.delete","value":"true","source":"DEFAULT_CONFIG"},{"key":"redpanda.iceberg.mode","value":"disabled","source":"DEFAULT_CONFIG"},{"key":"redpanda.leaders.preference","value":"none","source":"DEFAULT_CONFIG"},{"key":"redpanda.remote.delete","value":"true","source":"DEFAULT_CONFIG"},{"key":"redpanda.remote.read","value":"false","source":"DEFAULT_CONFIG"},{"key":"redpanda.remote.write","value":"false","source":"DEFAULT_CONFIG"},{"key":"retention.bytes","value":"-1","source":"DEFAULT_CONFIG"},{"key":"retention.local.target.bytes","value":"-1","source":"DEFAULT_CONFIG"},{"key":"retention.local.target.ms","value":"86400000","source":"DEFAULT_CONFIG"},{"key":"retention.ms","value":"604800000","source":"DEFAULT_CONFIG"},{"key":"segment.bytes","value":"134217728","source":"DEFAULT_CONFIG"},{"key":"segment.ms","value":"1209600000","source":"DEFAULT_CONFIG"},{"key":"write.caching","value":"true","source":"DEFAULT_CONFIG"}],"partitions":[{"partition":0,"leader":0,"epoch":1,"replicas":[0],"log_start_offset":0,"high_watermark":0}]}]
[
  {
    "summary": {
      "name": "foo",
      "internal": false,
      "partitions": 1,
      "replicas": 1,
      "error": ""
    },
    "configs": [
      {
        "key": "cleanup.policy",
        "value": "delete",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "compression.type",
        "value": "producer",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "delete.retention.ms",
        "value": "-1",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "flush.bytes",
        "value": "262144",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "flush.ms",
        "value": "100",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "initial.retention.local.target.bytes",
        "value": "-1",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "initial.retention.local.target.ms",
        "value": "-1",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "max.message.bytes",
        "value": "1048576",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "message.timestamp.type",
        "value": "CreateTime",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "redpanda.iceberg.delete",
        "value": "true",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "redpanda.iceberg.mode",
        "value": "disabled",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "redpanda.leaders.preference",
        "value": "none",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "redpanda.remote.delete",
        "value": "true",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "redpanda.remote.read",
        "value": "false",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "redpanda.remote.write",
        "value": "false",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "retention.bytes",
        "value": "-1",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "retention.local.target.bytes",
        "value": "-1",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "retention.local.target.ms",
        "value": "86400000",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "retention.ms",
        "value": "604800000",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "segment.bytes",
        "value": "134217728",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "segment.ms",
        "value": "1209600000",
        "source": "DEFAULT_CONFIG"
      },
      {
        "key": "write.caching",
        "value": "true",
        "source": "DEFAULT_CONFIG"
      }
    ],
    "partitions": [
      {
        "partition": 0,
        "leader": 0,
        "epoch": 1,
        "replicas": [
          0
        ],
        "log_start_offset": 0,
        "high_watermark": 0
      }
    ]
  }
]

Fixes ENG-124

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.3.x
  • v24.2.x
  • v24.1.x

Release Notes

Improvements

  • rpk topic describe now supports the --format flag to display the output in either JSON or YAML.

@r-vasquez
Copy link
Contributor Author

/dt

@redpanda-data redpanda-data deleted a comment from vbotbuildovich Dec 2, 2024
@redpanda-data redpanda-data deleted a comment from vbotbuildovich Dec 2, 2024
@redpanda-data redpanda-data deleted a comment from vbotbuildovich Dec 2, 2024
@redpanda-data redpanda-data deleted a comment from vbotbuildovich Dec 2, 2024
@r-vasquez
Copy link
Contributor Author

/dt

@vbotbuildovich
Copy link
Collaborator

the below tests from https://buildkite.com/redpanda/redpanda/builds/59139#0193898e-873a-4163-b3a7-f1c924b80eba have failed and will be retried

gtest_raft_rpunit

Adds format flag to rpk topic describe.

Supports JSON and YAML
@r-vasquez r-vasquez marked this pull request as ready for review December 3, 2024 19:57
@r-vasquez r-vasquez changed the title [WIP] rpk: add --format flag to rpk topic describe rpk: add --format flag to rpk topic describe Dec 3, 2024
Copy link
Contributor

@gene-redpanda gene-redpanda left a comment

Choose a reason for hiding this comment

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

LGTM

@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Dec 3, 2024

Retry command for Build#59187

please wait until all jobs are finished before running the slash command

/ci-repeat 1
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":true,"clean_node_before_recovery":false}
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":false,"clean_node_before_recovery":false}
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_escape_hatch_license_variable@{"clean_node_before_upgrade":false}
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":false,"clean_node_before_recovery":true}
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_escape_hatch_license_variable@{"clean_node_before_upgrade":true}
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":true,"clean_node_before_recovery":true}

@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Dec 3, 2024

non flaky failures in https://buildkite.com/redpanda/redpanda/builds/59187#01938e5c-db8c-4a15-8f3f-e4b2559a9cfa:

"rptest.tests.license_enforcement_test.LicenseEnforcementTest.test_license_enforcement.clean_node_before_recovery=True.clean_node_after_recovery=False"

non flaky failures in https://buildkite.com/redpanda/redpanda/builds/59187#01938e5c-db92-446d-8a33-214acd316f85:

"rptest.tests.license_enforcement_test.LicenseEnforcementTest.test_escape_hatch_license_variable.clean_node_before_upgrade=True"

non flaky failures in https://buildkite.com/redpanda/redpanda/builds/59187#01938e78-9377-4443-8943-caea72010d16:

"rptest.tests.license_enforcement_test.LicenseEnforcementTest.test_license_enforcement.clean_node_before_recovery=True.clean_node_after_recovery=False"

non flaky failures in https://buildkite.com/redpanda/redpanda/builds/59187#01938e78-9378-492b-98a6-b76f343cd4a9:

"rptest.tests.license_enforcement_test.LicenseEnforcementTest.test_escape_hatch_license_variable.clean_node_before_upgrade=True"

@r-vasquez
Copy link
Contributor Author

^ Unrelated License enforcement issues were fixed by #24426

I'm going to retry the whole CI pipeline just to make sure we are good.

@r-vasquez r-vasquez merged commit cddb5ef into redpanda-data:dev Dec 4, 2024
25 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.3.x

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

Successfully merging this pull request may close these issues.

4 participants