Skip to content

Conversation

@r-vasquez
Copy link
Contributor

Techincally speaking, rpk already supports user
based quotas, this commit only fixes a few code
smells and adds the user type to our rpk ducktape
test.

Example

$ rpk cluster quotas alter --add consumer_byte_rate=200000 --default user
ENTITY          STATUS
user=<default>  OK

$ rpk cluster quotas alter --add controller_mutation_rate=512,consumer_byte_rate=200000 --name user=foo
ENTITY    STATUS
user=foo  OK

$ rpk cluster quotas describe
user=<default>
        consumer_byte_rate=200000

client-id-prefix=bar-
        consumer_byte_rate=200000

user=foo
        consumer_byte_rate=200000
        controller_mutation_rate=512

Note: client-id-prefix was added before, just here for illustration purposes

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
  • v25.3.x
  • v25.2.x
  • v25.1.x

Release Notes

  • none

@r-vasquez r-vasquez requested review from a team and kbatuigas as code owners February 3, 2026 01:17
@r-vasquez r-vasquez requested review from Copilot and weeco and removed request for a team February 3, 2026 01:17
Copy link
Contributor

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 enhances rpk's quota management to explicitly include user-based quotas. While rpk technically supported user quotas before, this change improves code quality by replacing boolean maps with empty struct maps and updates error messages to reflect all supported entity types. The PR also adds test coverage for user quotas.

Changes:

  • Refactored Go code to use map[string]struct{} instead of map[string]bool for validation maps
  • Updated error messages to dynamically list all supported entity types instead of hardcoding them
  • Added test coverage for user-based quotas in the ducktape test suite

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/rptest/tests/rpk_cluster_quota_test.py Adds user quota test case and updates assertions to account for the new quota entry
src/go/rpk/pkg/cli/cluster/quotas/quotas.go Refactors validation maps to use empty structs and updates comments about entity type support
src/go/rpk/pkg/cli/cluster/quotas/describe.go Updates validation checks and error messages to dynamically list supported types
src/go/rpk/pkg/cli/cluster/quotas/alter.go Updates validation checks, error messages, and command documentation to include user entity type

Techincally speaking, rpk already supports user
based quotas, this commit only fixes a few code
smells and adds the user type to our rpk ducktape
test.
@vbotbuildovich
Copy link
Collaborator

CI test results

test results on build#79994
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
DatalakeClusterRestoreTest test_restore_partition_spec {"catalog_type": "rest_hadoop", "cloud_storage_type": 1} integration https://buildkite.com/redpanda/redpanda/builds/79994#019c211f-b3ce-4771-a897-840a507b6d57 FLAKY 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0000, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=DatalakeClusterRestoreTest&test_method=test_restore_partition_spec

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants