remotes/docker: Only return "already exists" on push when the upload was successful

The `(dockerPusher).Push` method uses a `StatusTracker` to check if an
upload already happened, before repeating the upload. However, there is
no provision for failure handling. If a PUT request returns an error,
the `StatusTracker` will still see the upload as if it happened
successfully. Add a status boolean so that only successful uploads
short-circuit `Push`.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
This commit is contained in:
Aaron Lehmann
2021-03-26 18:04:31 -07:00
parent dc8af03baf
commit 4c1fa57194
2 changed files with 7 additions and 3 deletions

View File

@@ -28,6 +28,8 @@ import (
type Status struct {
content.Status
Committed bool
// UploadUUID is used by the Docker registry to reference blob uploads
UploadUUID string
}