Skip to content

Conversation

@kichristensen
Copy link
Contributor

What does this change

Adds validation during porter build to detect if a file or directory named porter exists in the bundle directory. Returns a clear error message before the confusing runtime failure occurs.

Before: Bundle build succeeds but installation fails with:

could not create outputs directory /cnab/app/porter/outputs: mkdir /cnab/app/porter: not a directory

After: Build fails early with clear error:

a file or directory named "porter" exists in /path/to/bundle, which will conflict with Porter's internal directory structure. Please rename or remove it, or add it to .dockerignore

What issue does it fix

Closes #3536

Notes for the reviewer

The fix adds validation in BuildOptions.Validate() to check for the conflicting porter file/directory before the build process copies files into the bundle image. Two test cases cover both file and directory scenarios.

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Detect if file/directory named "porter" exists in bundle
directory during build validation. Return clear error before
confusing runtime failure occurs.

Fixes getporter#3536

Signed-off-by: Kim Christensen <[email protected]>
@kichristensen kichristensen changed the title fix: validate porter file/dir conflicts Validate porter file/dir conflicts Jan 13, 2026
@kichristensen kichristensen marked this pull request as ready for review January 13, 2026 22:14
@kichristensen kichristensen requested a review from a team as a code owner January 13, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Having a file called porter in your working directory results in unclear errors

2 participants