pulp / pulp/pulp-operator

Publication base_url does not point to proper URI

Open
#1,350 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue
Dominant language
Go
Stars
88
Forks
66
Avg merge
53m
Merged PRs (30d)
1

Description

Version
$ helm -n pulp list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
pulp pulp 1 2024-09-03 16:54:04.919341315 +0300 EEST deployed pulp-operator-0.1.0 1.0.1-beta.4

Stable pulp images.

Describe the bug
Distribution "base_url" value is useless and wrong (or maybe I'm wrong).

pulp> rpm distribution list
Not all 1 entries were shown.
[
  {
    "pulp_href": "/pulp/api/v3/distributions/rpm/rpm/0191e659-a5f8-70ca-b136-65891d31d7c5/",
    "pulp_created": "2024-09-12T13:08:40.570826Z",
    "pulp_last_updated": "2024-09-12T13:08:40.570857Z",
    "base_path": "mongo-6/tst",
    "base_url": "http://pulp-web-svc.pulp.svc.cluster.local:24880/pulp/content/mongo-6/tst/",
    "content_guard": null,
    "no_content_change_since": null,
    "hidden": false,
    "pulp_labels": {},
    "name": "mongo-6-tst",
    "repository": "/pulp/api/v3/repositories/rpm/rpm/0191e657-f42f-7ffe-b0cf-6247ef9ded82/",
    "publication": null,
    "generate_repo_config": false
  }
]

Also, it is strange that "Not all 1 entries were shown" is displayed, but this is another issue of pulp cli.

The base_url value "http://pulp-web-svc.pulp.svc.cluster.local:24880/pulp/content/mongo-6/tst/" does not make sense. Pulp CR is not configured to enable web at all, no pulp-web is running. There should be nothing available at that URI.
I can see from pulp-content logs that actual content is served from proper base url:

::ffff:10.2.3.17 [12/Sep/2024:13:09:04 +0000] "GET /pulp/content/mongo-6/tst/repodata/repomd.xml HTTP/1.1" 200 260 "https://pulp3.domain.tld/pulp/content/mongo-6/tst/repodata/" "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0"

This deployment has custom ingress based on Pulp CR config, not using one created by Pulp CR due to issues with annotations I had initially.

To Reproduce
Deploy Pulp CR without web and ingress resources, but specify "ingress_host"
Create rpm remote, repo, sync and publish, create distribution.
Check properties of a distribution to see that base_url does not point to host variable ingress_host.

Expected behavior
A Pulp distribution field base_url should have proper value "https://pulp3.domain.tld/pulp/content/mongo-6/tst/"
where "pulp3.domain.tld" is actual proper hostname of the ingress by using "ingress_host" value for hostname.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Pulp CR handling for ingress_host and the distribution base_url generated when web and ingress resources are disabled. Reproduce the deployment described in the issue, then trace how the hostname is selected. Done means a distribution uses the configured ingress_host and produces the expected HTTPS content URL in this setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.