Files
docker-cli/components/engine/pkg
Tonis Tiigi 8061bcd2a7 archive: add test for prefix header
With docker-17.06.0 some images pulled do not extract properly. Some files don't appear in correct directories. This may or may not cause the pull to fail. These images can't be pushed or saved. 17.06 is the first version of Docker built with go1.8.

Cause

There are multiple updates to the tar package in go1.8.

https://go-review.googlesource.com/c/32234/ disables using "prefix" field when new tar archives are being written. Prefix field was previously set when a record in the archive used a path longer than 100 bytes.

Another change https://go-review.googlesource.com/c/31444/ makes the reader ignore the "prefix" field value if the record is in GNU format. GNU format defines that same area should be used for access and modified times. If the "prefix" field is not read, a file will only be extracted by the basename.

The problem is that with a previous version of the golang archive package headers could be written, that use the prefix field while at the same time setting the header format to GNU. This happens when numeric fields are big enough that they can not be written as octal strings and need to be written in binary. Usually, this shouldn't happen: uid, gid, devmajor, devminor can use up to 7 bytes, size and timestamp can use 11. If one of the records does overflow it switches the whole writer to GNU mode and all next files will be saved in GNU format.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4a3cfda45e37b81211fbfbf0c45dbe64860a3ad0
Component: engine
2017-07-14 10:20:48 -07:00
..
2017-07-03 13:13:09 -07:00
2016-12-27 17:32:15 +08:00
2017-07-03 13:13:09 -07:00
2017-04-21 12:31:16 -04:00
2017-06-01 16:22:00 -07:00
2017-07-03 10:32:47 -07:00
2017-04-27 09:26:21 -07:00
2016-12-28 09:43:27 +08:00
2017-05-08 17:02:02 -07:00
2017-07-03 13:13:09 -07:00
2017-07-03 13:13:09 -07:00
2017-07-03 13:13:09 -07:00
2017-05-08 17:02:02 -07:00
2017-05-08 17:02:02 -07:00
2016-11-13 20:08:51 -08:00
2017-07-03 13:13:09 -07:00
2017-07-03 13:13:09 -07:00
2017-06-19 15:59:00 +03:00
2017-06-26 10:07:04 -07:00

pkg/ is a collection of utility packages used by the Docker project without being specific to its internals.

Utility packages are kept separate from the docker core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Docker organization, to facilitate re-use by other projects. However that is not the priority.

The directory pkg is named after the same directory in the camlistore project. Since Brad is a core Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!

Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!