Skip to content

fix: paginate cluster secret list so all secrets are returned - #906

Merged
mcncl merged 2 commits into
buildkite:mainfrom
AruneshDwivedi:fix/894-secret-list-pagination
Jul 29, 2026
Merged

fix: paginate cluster secret list so all secrets are returned#906
mcncl merged 2 commits into
buildkite:mainfrom
AruneshDwivedi:fix/894-secret-list-pagination

Conversation

@AruneshDwivedi

Copy link
Copy Markdown
Contributor

Description

bk secret list only ever returned the first page of cluster secrets (up to 30), with no way to fetch the rest. With more than 30 secrets in a cluster the remaining ones were silently dropped from the output.

Changes

  • cmd/secret/list.go now loops the ClusterSecrets.List call using ClusterSecretsListOptions with PerPage: 100, following Response.NextPage until it is zero, accumulating every page.
  • Added TestListSecretsPaginates to cmd/secret/secret_test.go to assert that a two-page response (Link rel=next) yields all 50 secrets.

Testing

  • Tests have run locally (go test ./cmd/secret/)
  • Code is formatted (go fmt ./...)

@AruneshDwivedi
AruneshDwivedi requested review from a team as code owners July 11, 2026 04:02
@mcncl
mcncl enabled auto-merge (squash) July 29, 2026 04:28
@mcncl
mcncl merged commit bb6d39e into buildkite:main Jul 29, 2026
3 checks passed
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.

2 participants