parabuzzle / craneoperator

Gives you a simple web interface for browsing around a Docker Registry
https://hub.docker.com/r/parabuzzle/craneoperator
MIT License
127 stars 32 forks source link

Infinite loop in /api/containers #52

Open daknin opened 6 years ago

daknin commented 6 years ago

Pointing craneoperator to our internal Docker registry causes the /api/containers endpoint to go into an infinite loop.

The code assumes that the GET call to /v2/_catalog will return an empty collection when the last page has been reached. In the Docker registry implementation we are using, asking for the page after the last one returns the first page again, triggering an infinite loop.

As per the Docker spec (https://docs.docker.com/registry/spec/api/#listing-repositories) craneoperator should the link header to step through the pages and the absence of a response 'link' header would indicate that all repositories have been retrieved.