Bug 2239169 - tripleo-common does not honor registry pagination
Summary: tripleo-common does not honor registry pagination
Keywords:
Status: CLOSED DUPLICATE of bug 2221618
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-common
Version: 16.2 (Train)
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact: David Rosenfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-09-15 16:55 UTC by Ina Panova
Modified: 2023-09-18 03:56 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-18 03:55:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-28757 0 None None None 2023-09-15 17:02:56 UTC

Description Ina Panova 2023-09-15 16:55:10 UTC
Description of problem:

Satellite container registry has pagination when tags are being listed.

triplo does not follow the Link header:
```
def _inspect(cls, image_url, session=None, default_tag=False):
        image, tag = cls._image_tag_from_url(image_url)
        parts = {
            'image': image,
            'tag': tag
        }
    
        tags_url = cls._build_url(
            image_url, CALL_TAGS % parts
        )
        tags_r = RegistrySessionHelper.get(session, tags_url, timeout=30)
        tags = tags_r.json()['tags']
        ---snip---

```

and here
```
def _tags_for_image(cls, image, session):
        url = cls._image_to_url(image)
        parts = {
            'image': url.path,
        }
        tags_url = cls._build_url(
            url, CALL_TAGS % parts 
        )
        r = session.get(tags_url, timeout=30)
        if r.status_code in (403, 404):
            return image, []
        tags = r.json()
        return image, tags.get('tags', [])
      
[ipanova@puffy tripleo-common]$ git grep Link
tripleo_common/image/image_export.py:        LOG.debug('[%s] Linking layers: %s -> %s' %

```

This is(or similar) the logic that it needs implemented https://github.com/pulp/pulp_container/blob/main/pulp_container/app/tasks/sync_stages.py#L338

Version-Release number of selected component (if applicable):
RHOSP 16.2.5
$ rpm -qa|grep tripleo.commonopenstack-tripleo-common-containers-11.7.1-2.20230308005004.99d0f05.el8ost.noarchopenstack-tripleo-common-11.7.1-2.20230308005004.99d0f05.el8ost.noarchpython3-tripleo-common-11.7.1-2.20230308005004.99d0f05.el8ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ina Panova 2023-09-15 17:01:52 UTC
and the command to run to hit this bugs is `openstack undercloud install`

Comment 2 Ian Ballou 2023-09-15 17:15:23 UTC
Pagination spec: https://docs.docker.com/registry/spec/api/#pagination-1

Comment 4 Rabi Mishra 2023-09-18 03:56:31 UTC

*** This bug has been marked as a duplicate of bug 2221618 ***


Note You need to log in before you can comment on or make changes to this bug.