Add manifest put by digest to the registry client

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
This commit is contained in:
Richard Scothern 2016-01-26 14:20:23 -08:00
parent 609bc63dd4
commit f757372dd8
2 changed files with 38 additions and 4 deletions

View file

@ -815,6 +815,7 @@ func TestManifestPut(t *testing.T) {
if err != nil {
t.Fatal(err)
}
var m testutil.RequestResponseMap
m = append(m, testutil.RequestResponseMapping{
Request: testutil.Request{
@ -831,6 +832,22 @@ func TestManifestPut(t *testing.T) {
},
})
putDgst := digest.FromBytes(m1.Canonical)
m = append(m, testutil.RequestResponseMapping{
Request: testutil.Request{
Method: "PUT",
Route: "/v2/" + repo.Name() + "/manifests/" + putDgst.String(),
Body: payload,
},
Response: testutil.Response{
StatusCode: http.StatusAccepted,
Headers: http.Header(map[string][]string{
"Content-Length": {"0"},
"Docker-Content-Digest": {putDgst.String()},
}),
},
})
e, c := testServer(m)
defer c()
@ -848,6 +865,10 @@ func TestManifestPut(t *testing.T) {
t.Fatal(err)
}
if _, err := ms.Put(ctx, m1); err != nil {
t.Fatal(err)
}
// TODO(dmcgowan): Check for invalid input error
}