mirror of
https://github.com/docker/cli.git
synced 2026-01-15 07:40:57 +03:00
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> Upstream-commit: e0702e9f373f5086f53de2485262dde9fc1e7ac2 Component: engine