Skip to content

mz863: apply COPY --chmod to implicitly created parent directories#866

Open
mzihlmann wants to merge 2 commits into
mainfrom
mz863-chmod-implicit-parent-dirs
Open

mz863: apply COPY --chmod to implicitly created parent directories#866
mzihlmann wants to merge 2 commits into
mainfrom
mz863-chmod-implicit-parent-dirs

Conversation

@mzihlmann

Copy link
Copy Markdown
Collaborator

Fixes #863

COPY --chmod applied the mode to the copied file but left implicitly created parent directories at a fixed 0755, so kaniko and buildkit produced different directory permissions for the same Dockerfile. FF_KANIKO_COPY_CHMOD_ON_IMPLICIT_DIRS was meant to cover this but only wired into the directory copy path, never the single file copy that creates parents through createParentDirectory. This threads the implicit-dir permission through CreateFile and createParentDirectory so the flag applies on that path too, matching buildkit including the umask handling.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/util/fs_util.go 80.00% 0 Missing and 2 partials ⚠️
pkg/buildcontext/gcs.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@mzihlmann mzihlmann requested review from 0hlov3, BobDu, babs and nejch July 3, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COPY --chmod is not applied to implicitly created parent directories

1 participant