Add pagination support to ingress list#915
Merged
Merged
Conversation
Mirror the egress list pagination: a new --limit flag walks pages via NextPageToken, prepending each older page so output stays in chronological oldest-first order. Without --limit, behavior is unchanged (single API page). JSON output keeps the response-object shape for compatibility. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
boks1971
approved these changes
Jul 16, 2026
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.
Summary
--limitflag tolk ingress listand walksNextPageTokenpages until the limit is reached or pages run out, mirroringlk egress list(Add pagination support to egress list #851).--limit, behavior is unchanged: a single request returning one API page. The--idpath is also unchanged (single request withid+roomfilters).{"items": [...]}response-object shape (unlike egress's bare array) for compatibility with existing consumers; the deprecatedlist-ingresscommand has nolimitflag and keeps single-page behavior.egress_test.go: fake twirp Ingress service covering token walking, limit truncation, stop-on-empty-token, single-page default, and cross-page ordering.Part of CS-1185.
Test plan
go test ./cmd/lk/lk ingress list --limit Nagainst a project with >1 page of ingresses; confirm no overlap and chronological ordering.🤖 Generated with Claude Code