fleet dump CLI: Internal pagination when fetching resources#4588
Merged
p-se merged 1 commit intorancher:mainfrom Feb 12, 2026
Merged
fleet dump CLI: Internal pagination when fetching resources#4588p-se merged 1 commit intorancher:mainfrom
p-se merged 1 commit intorancher:mainfrom
Conversation
ab01c6a to
7220488
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds internal pagination support to the fleet dump CLI to avoid holding large resource lists in memory and reduce API server load, and fixes duplicated namespace collection from Cluster resources (ref #4419).
Changes:
- Introduces
FetchLimitplumbing through the dump command/options to control list pagination. - Implements pagination for dynamic client resource listing (Fleet resources/Contents) and for controller-runtime client listing in events/metrics paths.
- Updates and extends unit tests to cover namespace de-duplication and pagination behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cmd/cli/dump/dump.go | Adds FetchLimit option and pagination loops for multiple list operations; de-duplicates namespaces. |
| internal/cmd/cli/dump/dump_test.go | Adds/updates tests for namespace de-duplication and pagination (including tar output). |
| internal/cmd/cli/dump.go | Exposes --fetch-limit CLI flag and passes it into dump options. |
| internal/cmd/builder.go | Extends command builder to support int64 CLI flags. |
| integrationtests/cli/dump/suite_test.go | Import formatting change only. |
| e2e/single-cluster/cli_dump_test.go | Import formatting change only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8201278 to
79458ac
Compare
weyfonk
reviewed
Feb 10, 2026
| opts := []client.ListOption{ | ||
| client.InNamespace(svc.Namespace), | ||
| matchingLabels, | ||
| client.Limit(fetchLimit), |
Contributor
There was a problem hiding this comment.
I'd be surprised if we actually needed this limit here, considering that we're only using it to fetch monitoring services, but I guess it doesn't harm :)
weyfonk
approved these changes
Feb 11, 2026
weyfonk
approved these changes
Feb 11, 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.
Instead of holding all resources in memory, write them in batches. Also eases the load on the cluster by only fetching a certain amount of resources at a time.
Also fixes an issue with collecting duplicated namespaces from cluster resources.
Refers to #4419
Additional Information
Checklist
fleet-docs repository.