Skip to content

Instantly share code, notes, and snippets.

@marvinpinto
Last active September 9, 2015 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marvinpinto/57c2933ed2415edb1293 to your computer and use it in GitHub Desktop.
Save marvinpinto/57c2933ed2415edb1293 to your computer and use it in GitHub Desktop.
Possible quay.io API pagination bug

Here is a tiny example:

[mp-x1: 22:03:29] ~
$ curl -s -X GET -H "Content-Type: application/json" https://quay.io/api/v1/repository/travisci/travis-android/tag/?limit=3\&page=1 | python -m json.tool
{
    "has_additional": true,
    "page": 1,
    "tags": [
        {
            "docker_image_id": "aefa3995f41e2d6896530d512fa8415e5d2346058b9a55da28194cc4aa4624dd",
            "name": "latest-2015-04-28_13-50-33",
            "reversion": false,
            "start_ts": 1430229039
        },
        {
            "docker_image_id": "aefa3995f41e2d6896530d512fa8415e5d2346058b9a55da28194cc4aa4624dd",
            "name": "latest",
            "reversion": false,
            "start_ts": 1430229027
        },
        {
            "docker_image_id": "e026049d091db428ca1d87d9b4408457effbb4d133f27d89d67722de33463fb7",
            "name": "latest-2015-04-27_20-01-46",
            "reversion": false,
            "start_ts": 1430164922
        }
    ]
}

[mp-x1: 22:03:37] ~
$ curl -s -X GET -H "Content-Type: application/json" https://quay.io/api/v1/repository/travisci/travis-android/tag/?limit=3\&page=2 | python -m json.tool
{
    "has_additional": true,
    "page": 1,
    "tags": [
        {
            "docker_image_id": "aefa3995f41e2d6896530d512fa8415e5d2346058b9a55da28194cc4aa4624dd",
            "name": "latest-2015-04-28_13-50-33",
            "reversion": false,
            "start_ts": 1430229039
        },
        {
            "docker_image_id": "aefa3995f41e2d6896530d512fa8415e5d2346058b9a55da28194cc4aa4624dd",
            "name": "latest",
            "reversion": false,
            "start_ts": 1430229027
        },
        {
            "docker_image_id": "e026049d091db428ca1d87d9b4408457effbb4d133f27d89d67722de33463fb7",
            "name": "latest-2015-04-27_20-01-46",
            "reversion": false,
            "start_ts": 1430164922
        }
    ]
}

It looks as if the API does not respect the page parameter and as a result always returns the first page. Is there something I'm doing wrong here?

@marvinpinto
Copy link
Author

For full context on this gist, see https://botbot.me/freenode/quayio/2015-09-09/?msg=49297298

tldr: It looks like there is/was a bug with the page parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment