"Old" Containerfile being used in the builder machinery
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31
- Forks
- 56
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 22
Description
Describe the bug
If we push another version of a Containerfile to Pulp and try to build using it, the builder machinery will not use the latest version.
To Reproduce
Steps to reproduce the behavior:
pulp container repository create --name my-container-repo
pulp file repository create --name my-file-repo
cat<<EOF> /tmp/Containerfile
FROM quay.io/fedora/fedora-bootc:40
RUN dnf install -y hello
EOF
pulp file content upload --relative-path Containerfile --file /tmp/Containerfile --repository my-file-repo
curl ${CONTAINER_REPO}/build_image -F containerfile_name=Containerfile -F build_context={FILE_REPO}versions/1/
echo "RUN dnf install -y vim" >> /tmp/Containerfile
pulp file content upload --relative-path Containerfile --file /tmp/Containerfile --repository my-file-repo
curl ${CONTAINER_REPO}/build_image -F containerfile_name=Containerfile -F build_context={FILE_REPO}versions/2/
The build task will run, but a new manifest will not be created after these steps.
pulp container content -tmanifest list
Additional context
As a workaround, instead of using the same filename, uploading the Containerfile with a different name would work.
maybe modifying the line:
https://github.com/pulp/pulp_container/blob/473ec48fa9b5d84e52d43575c57be411b25c47c3/pulp_container/app/tasks/builder.py#L149
to:
for content_artifact in content_artifacts.select_related("artifact").order_by("pulp_created").iterator():
would fix this issue because the containerfile_artifact would be overwritten with the latest version:
https://github.com/pulp/pulp_container/blob/473ec48fa9b5d84e52d43575c57be411b25c47c3/pulp_container/app/tasks/builder.py#L150-L151
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pulp_container/app/tasks/builder.py around lines 149-151, then follow how the selected Containerfile artifact is used by the build task. Reproduce the two-version upload sequence from the issue and verify that building from version 2 creates the expected new manifest in the container content manifest list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100