Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conflict on heredoc temp files #5721

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kmichel-aiven
Copy link

What type of PR is this?

/kind bug

What this PR does / why we need it:

If two image builds start concurrently and they both use an heredoc with the same EOF marker, then they will use the same filename and overwrite each other.

It's possible for concurrent builds to either use the wrong heredoc content or to fail because the file of one build is deleted by the other, leading to this error message:

STEP 13/21: COPY <<EOF /file.conf

Error: building at STEP "COPY <<EOF /file.conf": reading "/var/tmp/EOF": copier: get: globs [/EOF] matched nothing (0 filtered out): no such file or directory

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?


If two image builds start concurrently and they both use an heredoc with the same EOF marker, then they will use the same filename and overwrite each other.

It's possible for concurrent builds to either use the wrong heredoc content or to fail because the file of one build is deleted by the other, leading to this error message:

```
STEP 13/21: COPY <<EOF /file.conf

Error: building at STEP "COPY <<EOF /file.conf": reading "/var/tmp/EOF": copier: get: globs [/EOF] matched nothing (0 filtered out): no such file or directory
```

Signed-off-by: Kevin Michel <kevin.michel@aiven.io>
@openshift-ci openshift-ci bot added do-not-merge/work-in-progress kind/bug Categorizes issue or PR as related to a bug. labels Sep 5, 2024
Copy link
Contributor

openshift-ci bot commented Sep 5, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kmichel-aiven
Once this PR has been reviewed and has the lgtm label, please assign giuseppe for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmichel-aiven
Copy link
Author

I would like to add tests but I'm not familiar with the project, what would be the best place to add these ?

(I've tried adding to bud.bats but run_buildah doesn't seem ready to test concurrent operations.)

@kmichel-aiven kmichel-aiven marked this pull request as ready for review September 5, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant