Merge pull request #3750 from ecordell/202-accepted-response

Allow 202 response code for commit
This commit is contained in:
Michael Crosby 2019-10-14 11:13:19 -04:00 committed by GitHub
commit 9c86b8f5ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -339,9 +339,9 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di
} }
// 201 is specified return status, some registries return // 201 is specified return status, some registries return
// 200 or 204. // 200, 202 or 204.
switch resp.StatusCode { switch resp.StatusCode {
case http.StatusOK, http.StatusCreated, http.StatusNoContent: case http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusAccepted:
default: default:
return errors.Errorf("unexpected status: %s", resp.Status) return errors.Errorf("unexpected status: %s", resp.Status)
} }