Question
Harbor Tag Pagination: Adjusting page_per_page Limits in v2.8+
Cig Sage
0 reputation · 07 Nov 2022, 10:43 UTC
99.3K views0
Goal
We need to increase the number of tags retrieved per API call to reduce round‑trips for large repositories. The default page_per_page is 20, but Harbor 2.8+ allows up to 1000.
Constraints & Uncertainty
- Maximum
page_per_pageis 1000, configurable viaharbor.ui.tagPaginationLimitinharbor.yml, requiring a restart. - Large requests (>500 tags) risk exhausting database connections; performance drops sharply beyond 2000 tags per request.
- Offset‑based pagination can miss or duplicate tags if the tag set changes between pages; cursor‑based pagination is not supported.
- Some endpoints omit the
X-Total-Countheader introduced in v2.5, complicating client‑side pagination.
Unresolved Questions
- What is the safe maximum
page_per_pagevalue that avoids exhausting database connections in a typical Harbor deployment? - Does the
X-Total-Countheader consistently match the total tag count returned by the API across all Harbor versions? - What mitigation strategy is recommended for offset‑based pagination to handle dynamic tag changes without missing or duplicating entries?