1
Fork 0

rootfs: remove ./ prefix from filenames

I've seen a container (private one) whose filenames start with ./, but
the layer name does not have the prefix, causing undocker to fail.

Let's always normalize the names to not have the prefix.
main v1.0.3
Motiejus Jakštys 10 months ago
parent 41baf180a3
commit 4408a9e005
  1. 4
      rootfs/rootfs.go

@ -69,7 +69,7 @@ func Flatten(rd io.ReadSeeker, w io.Writer) (_err error) {
if err != nil {
return err
}
layerOffsets[hdr.Name] = here
layerOffsets[strings.TrimPrefix(hdr.Name, "./")] = here
}
}
@ -82,7 +82,7 @@ func Flatten(rd io.ReadSeeker, w io.Writer) (_err error) {
for i, name := range manifest[0].Layers {
layers[i] = nameOffset{
name: name,
offset: layerOffsets[name],
offset: layerOffsets[strings.TrimPrefix(name, "./")],
}
}

Loading…
Cancel
Save