1599: recreate fifos and skip other special files during COPY - #948
1599: recreate fifos and skip other special files during COPY#948mzihlmann wants to merge 5 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughAdds the ChangesSpecial-file copying
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant IntegrationDockerfile
participant KanikoExecutor
participant CopyCommand
participant CreateFifo
participant Filesystem
IntegrationDockerfile->>KanikoExecutor: Build stage containing FIFO
KanikoExecutor->>CopyCommand: Execute COPY
CopyCommand->>CreateFifo: Recreate FIFO destination
CreateFifo->>Filesystem: Create FIFO and apply mode/ownership
KanikoExecutor->>IntegrationDockerfile: Complete build and run assertions
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/util/fs_util.go`:
- Around line 836-839: Update the FIFO handling in CopyDir and the createFifo
function to accept and propagate the resolved uid, gid, chmod, and
useDefaultChmod values. Apply the same target ownership and effective mode logic
used for regular files and directories, so COPY --chown and explicit COPY
--chmod override source metadata for FIFOs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8615f711-686a-45ae-8c45-1107f1205035
📒 Files selected for processing (5)
README.mdintegration/dockerfiles/Dockerfile_test_copy_special_filesintegration/images.gopkg/config/featureflags.gopkg/util/fs_util.go
2adeda7 to
06fe152
Compare
06fe152 to
99fb216
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
99fb216 to
d623def
Compare
|
Good catch, fixed. Two things fell out of chasing it:
The single-file
|
3c154b6 to
444c3e6
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/config/featureflags.go`:
- Line 103: Change CopySkipSpecialFiles in pkg/config/featureflags.go to default
to true, and remove the forced =1 override in integration/images.go so
integration runs validate the production default; retain explicit =false only
for compatibility coverage.
In `@pkg/util/fs_util.go`:
- Around line 836-840: Update the FIFO branch in the surrounding copy logic to
capture CreateFifo’s exclusion result and immediately continue when it indicates
the destination was excluded. Only queue timestamp handling and record the path
as copied when CreateFifo reports it was processed, matching the direct-file
COPY path behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c2b6ef95-b280-4000-9f00-fd9e494e31da
📒 Files selected for processing (7)
README.mdintegration/dockerfiles/Dockerfile_test_issue_1599integration/dockerfiles/Dockerfile_test_issue_1599_2integration/images.gopkg/commands/copy.gopkg/config/featureflags.gopkg/util/fs_util.go
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/util/fs_util.go`:
- Line 40: In the filesystem copy loop, handle an exclude result from
CopySymlink, CreateFifo, or CopyFile by continuing before timestamp and
copied-file bookkeeping; then remove the assert.Assert call and the pkg/assert
import. Ensure protected /kaniko destinations are skipped without panicking.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
b2a40dd to
a48fecf
Compare
a48fecf to
2041b1c
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
2041b1c to
f126cb8
Compare
Fixes GoogleContainerTools/kaniko#1599
Description
COPYcopies a file by opening it and reading it, which is wrong for anything that is not a regular file.Opening a fifo blocks until something else opens the other end, so a Dockerfile that copies a directory containing one hangs with no error, no timeout and no indication of which file is responsible. That is fixed unflagged: a build that never terminates is not behavior anyone can have depended on, which is the exception in docs/releases.md. Fifos are now recreated with
mkfifo, the same thing docker does and the same thing theotiai10/copylibrary already did for the paths that use it.Sockets and devices are gated behind
FF_KANIKO_COPY_SKIP_SPECIAL_FILES=falseinstead. A socket currently fails the build withENXIO, but a device opens fine and gets read as if it were a file, so its contents end up in the image in place of the device node. That build succeeds today and produces an image, so it gets a flag. Becomes default in v1.29.0.Summary by CodeRabbit
New Features
COPYhandling for named pipes (FIFOs), including permissions and ownership.FF_KANIKO_COPY_SKIP_SPECIAL_FILESto warn and skip sockets and device files.Bug Fixes
COPYoperations from hanging.Documentation
Tests