Adding a --include-path flag to kaniko build #2884
Labels
area/cli
bugs related to kaniko CLI
area/filesystems
For all bugs related to kaniko container filesystems (mounting issues etc)
kind/feature-request
priority/p2
High impact feature/bug. Will get a lot of users happy
Actual behavior
Hello Kaniko Team,
I'm encountering a challenge with persistent volume usage in Kaniko.
To manage ephemeral storage issues in Kaniko pods, I've set up a PVC/PV and mounted it at
/opt/my-user/my-big-dependencies-and-relevant-files
for building the image. With the build process utilizing the persistent volume effectively, thereby reducing the load on node ephemeral storage.However, I encountered an issue where the contents of
/opt/my-user/my-big-dependencies-and-relevant-files
are not included in the final image that is pushed to the registry. This results in the final image missing installed packages that were expected to be part of it.Upon investigating, I found that the internal logic of Kaniko, specifically in fs_util.go (fs_util.go#L455C6-L455C32), seems to skip directories listed in
/proc/self/mountinfo
during the snapshotting process. The logs indicate that/opt/my-user/my-big-dependencies-and-relevant-files
is recognized as mounted but is later 'whiteouted' and skipped in the final image.While Kaniko offers an
--ignore-paths
flag, it lacks an equivalentinclude-paths
option.Expected behavior
Have the mounted paths be part of the image. Or have flag that can be used to explicitly include those paths
To Reproduce
Steps to reproduce the behavior in kubernetes :
Thank you in advance for your assistance and looking forward to a possible enhancement in Kaniko's functionality.
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: