Project

Profile

Help

Issue #5659

closed

Regression: publishing an empty ISO repo no longer publishes PULP_MANIFEST

Added by rmcgover about 5 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.20.0
Platform Release:
2.21.1
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 63
Quarter:

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.

Also available in: Atom PDF