Issue #5659
closedRegression: publishing an empty ISO repo no longer publishes PULP_MANIFEST
Description
Publishing an ISO repo with no units will no longer publish an (empty) PULP_MANIFEST file.
It seems to be a regression introduced by fast-forward publish support for ISO repos in version 2.20.0.
Steps to reproduce¶
In dev-env:
1. Create a new, empty repo:
$ pulp-admin iso repo create --repo-id my-test-repo
2. Publish the repo:
$ pulp-admin iso repo publish run --repo-id my-test-repo
+----------------------------------------------------------------------+
Publishing Repository [my-test-repo]
+----------------------------------------------------------------------+
This command may be exited via ctrl+c without affecting the request.
The repository was successfully published.
Task Succeeded
3. Check for published repo:
$ sudo find /var/lib/pulp/published/ -wholename '*my-test-repo*'
Actual results¶
Step 3 finds no trace of the repo having been published (no PULP_MANIFEST or even an empty directory).
Expected results¶
Step 3 finds a repo published with an empty PULP_MANIFEST:
$ sudo find /var/lib/pulp/published/ -wholename '*my-test-repo*'
/var/lib/pulp/published/https/isos/my-test-repo
/var/lib/pulp/published/https/isos/my-test-repo/PULP_MANIFEST
Additional info¶
Publishing the empty PULP_MANIFEST is important since this is how Pulp/Satellite can know that a repo URL is valid but a repo doesn't include any content yet.
In publish_repo_fast_forward method, we can see that the copytree operation which ultimately performs the publish will never be entered if the repo contains no units:
# In pulp/server/pulp/plugins/file/distributor.py
def publish_repo_fast_forward(self, repo, publish_conduit, config):
...
if len(unit_absent_set) > 0 or len(unit_over_path_map) > 0:
if os.path.exists(metadata_filename):
os.remove(metadata_filename)
copytree(build_dir, location, symlinks=True)
Can be worked around by publishing empty repos with force_full: True.
If repository hasn't been published before, publish without fast-foward
If repository hasn't been published before and there's no unit associated with it, no PULP_MANIFEST is published to destination publish directory. With this fix, empty manifest is created in destination directory indicating that published repo is empty
Closes #5659