pivotal-cf / azure-blobstore-resource

A concourse resource to interact with the azure blob service.
MIT License
16 stars 15 forks source link

Handle pagination in resource checks #26

Closed crsimmons closed 5 years ago

crsimmons commented 5 years ago

We encountered https://github.com/pivotal-cf/azure-blobstore-resource/issues/24 on a client's environment. After some investigation we determined that the ListBlobs call that check does is not returning all the blobs in the container. We managed to replicate this using the Azure API and noticed that the response coming back from the SDK indicated it was the first page of a paginated response.

This PR adds logic to check which loops until NextMarker is empty (the last page of paginated results). We were having trouble getting the existing fake client structure to model paginated responses so we refactored to use counterfeiter for fakes generation.