pulp / pulp-cli

https://docs.pulpproject.org/pulp_cli/
GNU General Public License v2.0
36 stars 41 forks source link

Auto-refresh api-spec for other than version-changes #820

Open ggainey opened 10 months ago

ggainey commented 10 months ago

Currently we will auto-update api-spec if we notice that the pulp-instance you're pointing at, is running different versions than when last we refreshed the spec.

However - there are other ways for a spec to be invalid. If one instance has domains enabled, for example, and a second one running the same versions does not, their specs will not match.

We should trigger auto-refresh on more than just the version-list.

mdellweg commented 10 months ago

To be fair: We cache the api per hostname. But i still agree this can be improved.

lubosmj commented 6 months ago

Got bitten by this after enabling domains, recently. We should definitely trigger the refresh more frequently.

For me, the obvious querying did not work even though my configuration was correct (even after running pulp status which is supposed to clear the cache (?)):

pulp --domain default file distribution list
Error: 
<!doctype html>
<html lang="en">
<head>
  <title>Not Found</title>
</head>
<body>
  <h1>Not Found</h1><p>The requested resource was not found on this server.</p>
</body>
</html>
http :5001/pulp/default/api/v3/distributions/file/file/
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "base_path": "test",
            "base_url": "http://localhost:5001/pulp/content/default/test/",
            "content_guard": null,
            "hidden": false,
            "name": "test",
            "publication": "/pulp/default/api/v3/publications/file/file/018e393f-81f3-79d3-ace6-6bb161d31eac/",
            "pulp_created": "2024-03-13T19:20:07.067971Z",
            "pulp_href": "/pulp/default/api/v3/distributions/file/file/018e3941-f29a-73dc-ab0a-c85818b9f030/",
            "pulp_labels": {},
            "pulp_last_updated": "2024-03-13T19:20:07.067993Z",
            "repository": null
        }
    ]
}