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.
Updated by rmcgover about 5 years ago
Note also that if you have an iso_rsync_distributor attached to the same repo, attempting to publish with that distributor will fail as it attempts to rsync a nonexistent PULP_MANIFEST file.
Added by jluza almost 5 years ago
Updated by ipanova@redhat.com almost 5 years ago
- Status changed from NEW to POST
- Sprint set to Sprint 63
Updated by jluza almost 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp:pulp|9a7cc54f6fd320c48865824d7dd15735dcc410af.
Added by Nathan Gillett almost 5 years ago
Revision f93e517d | View on GitHub
Correct last_publish method call in distributor
In a recent commit to limit fast-forward publishing to repositories that have been published before, 'last_published' was mistaken for the publish_conduit's 'last_publish' method. This commit corrects the typo.
Closes #5659
Updated by Anonymous almost 5 years ago
Applied in changeset pulp:pulp|f93e517d6abd66cb372c3d2bbbf91e860dd1f93e.
Added by jluza over 4 years ago
Revision 7cbe4229 | View on GitHub
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
(cherry picked from commit 9a7cc54f6fd320c48865824d7dd15735dcc410af)
Added by Nathan Gillett over 4 years ago
Revision 3771fbe1 | View on GitHub
Correct last_publish method call in distributor
In a recent commit to limit fast-forward publishing to repositories that have been published before, 'last_published' was mistaken for the publish_conduit's 'last_publish' method. This commit corrects the typo.
Closes #5659
(cherry picked from commit f93e517d6abd66cb372c3d2bbbf91e860dd1f93e)
Updated by jluza over 4 years ago
Applied in changeset pulp:pulp|7cbe4229c5f0c8875e74d98c959554e95da2b790.
Updated by Anonymous over 4 years ago
Applied in changeset pulp:pulp|3771fbe16917ee920a03cd4d00dd622e74241b06.
Updated by ipanova@redhat.com over 4 years ago
- Status changed from MODIFIED to 5
Updated by ipanova@redhat.com over 4 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Added by yuzheng over 4 years ago
Revision 7fffd6d0 | View on GitHub
Fix last_publish method call
Method last_publish was not called properly so that a bound method was used instead of its return. It made publish always be fast-forward no matter repo has been published or not when force_full=True is not set.
Added new case for testing this and fixed tests added before.
Closes #5659
(cherry picked from commit 8bf831f8533f98512b620d49fdf6cae0f824257d)
Added by yuzheng over 4 years ago
Revision 668d4551 | View on GitHub
Fix last_publish method call
Method last_publish was not called properly so that a bound method was used instead of its return. It made publish always be fast-forward no matter repo has been published or not when force_full=True is not set.
Closes #5659
(cherry picked from commit 2403d7dde0b28d2aab603e3ba70555a69d653df5)
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