Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37705 - 404 v1 search with v2 container clients #42

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

ianballou
Copy link
Member

@ianballou ianballou commented Jul 31, 2024

Essentially https://github.com/Katello/katello/pull/11006/files but for the container gateway. For v2 container clients, don't use the old v1 search API endpoint. Instead, throw a 404.

To test, try doing podman search with an actual search field. For example:

podman search centos9-proxy-devel.manicotto.example.com/default_organization

This should return all container repositories with default_organization in the name.

Without this PR, adding anything past the / after the hostname causes nothing to get returned.

Test with and without being logged in.

Copy link

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so packit/PRT failed at SatelliteQE/robottelo#15820 coz it tried to patch the smart_proxy_container_gateway at the SAT side. This is going to be fixed in CI.

Nevertheless I tested this locally with patched Caps and it passed.

(venv) [vsedmik@fedora robottelo]$ pytest tests/foreman/api/test_capsulecontent.py -k test_positive_sync_container_repo_end_to_end
...
======= 1 passed, 23 deselected, 9 warnings in 714.58s (0:11:54) =======

So giving ACK from my side.

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK looks good and works:

Without PR:
Logged in and out produce the same results:

[root@ip-10-0-168-78 ~]# podman search --tls-verify=false ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com/default_organization
[root@ip-10-0-168-78 ~]#

With PR:

[root@ip-10-0-168-78 ~]# podman login --tls-verify=false ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com
Username: admin
Password:
Login Succeeded!

[root@ip-10-0-168-78 ~]# podman search --tls-verify=false ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com/default_organization
NAME                                                                                                    DESCRIPTION
ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com/default_organization-capsule-containers-custom-docker

[root@ip-10-0-168-78 ~]# podman logout ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com
Removed login credentials for ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com

[root@ip-10-0-168-78 ~]# podman search --tls-verify=false ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com/default_organization
NAME                                                                                                    DESCRIPTION
ip-10-0-168-217.rhos-01.prod.psi.rdu2.redhat.com/default_organization-capsule-containers-custom-docker

@ianballou ianballou merged commit 28fcc52 into Katello:main Aug 8, 2024
5 checks passed
@ianballou ianballou deleted the 37705-v1-search-404 branch August 8, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants