-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
NPE when adding LayerEntry relative to the root '/' #2195
Comments
Reproducible with |
I don't think there's any harm in having an explicit entry for |
Lets not generate this entry: |
Adding a directory into "/" was the first thing I tried. It would be nice if this worked. |
Environment:
Description of the issue:
Seeing NPEs when using jib-core to create a layer with content placed at "/":
The code in question:
jib/jib-core/src/main/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilder.java
Lines 73 to 76 in a692b8b
The layer configurations had been built with
LayerConfiguration.Builder.addEntryRecursive()
In this case,
tarEntryPath.getName()
is/
(the root directory).namePath
is asun.nio.fs.UnixPath
on "/" with filesystem of typesun.nio.fs.MacOSXFileSystem
. ButnamePath.getParent()
returnsnull
, which adheres to the contract ofPath#getParent()
: Returns the parent path, ornull
if this path does not have a parent.So an obvious fix is to change this guard to
But should we be adding a tar entry for the root directory?
The text was updated successfully, but these errors were encountered: