Skip to content

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

Open
AruneshDwivedi wants to merge 1 commit into
buildkite:mainfrom
AruneshDwivedi:fix/894-secret-list-pagination
Open

fix: paginate cluster secret list so all secrets are returned#906
AruneshDwivedi wants to merge 1 commit into
buildkite:mainfrom
AruneshDwivedi:fix/894-secret-list-pagination

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

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
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.

1 participant