mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-21 07:53:19 +02:00
omit uname/gname in tar headers
When using cache, the rootfs may not have been extracted. This prevents uname/gname from resolving as there is no /etc/password or /etc/group. This makes this layer unnecessarily differ from a cached layer which does contain this information. Omitting these should be consistent with Docker's behavior.
This commit is contained in:
@@ -84,6 +84,11 @@ func (t *Tar) AddFileToTar(p string) error {
|
||||
hdr.Name = p
|
||||
}
|
||||
|
||||
// rootfs may not have been extracted when using cache, preventing uname/gname from resolving
|
||||
// this makes this layer unnecessarily differ from a cached layer which does contain this information
|
||||
hdr.Uname = ""
|
||||
hdr.Gname = ""
|
||||
|
||||
hardlink, linkDst := t.checkHardlink(p, i)
|
||||
if hardlink {
|
||||
hdr.Linkname = linkDst
|
||||
|
||||
Reference in New Issue
Block a user