Set images.list maxResults to 10k and make it configurable - default was 500#548
Open
gbhat618 wants to merge 3 commits into
Open
Set images.list maxResults to 10k and make it configurable - default was 500#548gbhat618 wants to merge 3 commits into
images.list maxResults to 10k and make it configurable - default was 500#548gbhat618 wants to merge 3 commits into
Conversation
gbhat618
commented
May 8, 2026
| /** | ||
| * Lists images in {@code imageProject} with an explicit {@code maxResults}, bypassing the | ||
| * archived gcp-plugin-core-java {@code ComputeClient#listImages} which silently truncates | ||
| * at the server default of 500. |
Contributor
Author
There was a problem hiding this comment.
graphite library cannot be extended as library is archived
https://github.com/GoogleCloudPlatform/gcp-plugin-core-java/blob/3c517b2ab96f9c275d713c9903e4cd236a842f7b/gcp-client/src/main/java/com/google/cloud/graphite/platforms/plugin/client/ComputeWrapper.java#L86-L88
Contributor
Author
|
/label bug |
jglick
reviewed
May 11, 2026
| public List<Image> listImages(String imageProject, long maxResults) throws IOException { | ||
| var resp = compute.images().list(imageProject).setMaxResults(maxResults).execute(); | ||
| List<Image> items = resp.getItems(); | ||
| return items == null ? Collections.emptyList() : items; |
Contributor
Author
There was a problem hiding this comment.
images.list maxResults to 10k and make it configurable - default was 500
jglick
approved these changes
May 12, 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.
Whenever a GCP project had more than 500 images, the list was truncated to 500 - due to GCP server side default is 500.
https://docs.cloud.google.com/compute/docs/reference/rest/v1/images/list#query-parameters
This PR fixes by -
setMaxResultsto higher value (Integer.MAX_VALUE) whenimages().list()Testing
Reproduced the issue, with a project having 828 images.
2026-05-08 08:35:29.516+0000 [id=97] INFO c.g.j.p.c.InstanceConfiguration$DescriptorImpl#doFillBootDiskSourceImageNameItems: listImages() returned 500 images for project tiger-team-testing2026-05-08 08:32:21.842+0000 [id=144] INFO c.g.j.p.c.InstanceConfiguration$DescriptorImpl#doFillBootDiskSourceImageNameItems: listImages(maxResults=2147483647) returned 828 images for project tiger-team-testingSubmitter checklist