moby/distribution
Aaron Lehmann 1638b8f5c5 distribution: Fix panic on push
When building a manifest during a push operation, all layers must have
an associated descriptor. If a layer is missing a descriptor, that leads
to a panic.

A break inside a switch in layerAlreadyExists meant to break from the
loop surrounding the switch, but instead breaks from the switch. This
causes the loop to continue, and can overwrite the descriptor with an
empty one, leading to the panic.

Also, fix layerAlreadyExists not to abort the push when a speculative
stat on a candidate layer digest fails with an error. This could happen
in situations like a potential cross-repository mount where the user
does not have permission to access the source repository.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit e0702e9f37)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:14:42 -08:00
..
fixtures/validate_manifest Add distribution package 2015-11-24 09:40:24 -08:00
metadata Allow to mock V2MetadataService in unit tests 2016-09-29 14:16:00 +02:00
xfer Adds ability to squash image after build 2016-11-01 13:41:59 -04:00
errors.go Update pull error handling 2016-11-10 17:34:12 -08:00
pull.go Update pull error handling 2016-11-10 17:34:12 -08:00
pull_v1.go Generalize content addressable and reference storage 2016-09-15 18:08:19 -07:00
pull_v2.go Update for distribution vendor 2016-11-10 17:34:12 -08:00
pull_v2_test.go In error, the first letter is low-case letter 2016-09-23 17:30:13 +08:00
pull_v2_unix.go Removing old custom RootFS behavior on Windows. 2016-07-29 14:15:59 -07:00
pull_v2_windows.go Windows: Add debug output to foreign layer pull 2016-09-26 08:56:34 -07:00
push.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
push_v1.go Generalize content addressable and reference storage 2016-09-15 18:08:19 -07:00
push_v2.go distribution: Fix panic on push 2016-11-30 14:14:42 -08:00
push_v2_test.go distribution: Fix panic on push 2016-11-30 14:14:42 -08:00
registry.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
registry_unit_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00