Skip to content

"Old" Containerfile being used in the builder machinery #1813

Description

@git-hyagi

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:

for content_artifact in content_artifacts.select_related("artifact").iterator():

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:

if content_artifact.relative_path == containerfile_name:
containerfile_artifact = content_artifact.artifact

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions