Manifest PUT should return 201 Created
Change handler, update descriptors table, regenerate API spec, and update test. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>master
							parent
							
								
									50de6d914c
								
							
						
					
					
						commit
						24408263d9
					
				| 
						 | 
				
			
			@ -523,7 +523,7 @@ var routeDescriptors = []RouteDescriptor{
 | 
			
		|||
						Successes: []ResponseDescriptor{
 | 
			
		||||
							{
 | 
			
		||||
								Description: "The manifest has been accepted by the registry and is stored under the specified `name` and `tag`.",
 | 
			
		||||
								StatusCode:  http.StatusAccepted,
 | 
			
		||||
								StatusCode:  http.StatusCreated,
 | 
			
		||||
								Headers: []ParameterDescriptor{
 | 
			
		||||
									{
 | 
			
		||||
										Name:        "Location",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -423,7 +423,7 @@ func TestManifestAPI(t *testing.T) {
 | 
			
		|||
	checkErr(t, err, "building manifest url")
 | 
			
		||||
 | 
			
		||||
	resp = putManifest(t, "putting signed manifest", manifestURL, signedManifest)
 | 
			
		||||
	checkResponse(t, "putting signed manifest", resp, http.StatusAccepted)
 | 
			
		||||
	checkResponse(t, "putting signed manifest", resp, http.StatusCreated)
 | 
			
		||||
	checkHeaders(t, resp, http.Header{
 | 
			
		||||
		"Location":              []string{manifestDigestURL},
 | 
			
		||||
		"Docker-Content-Digest": []string{dgst.String()},
 | 
			
		||||
| 
						 | 
				
			
			@ -432,7 +432,7 @@ func TestManifestAPI(t *testing.T) {
 | 
			
		|||
	// --------------------
 | 
			
		||||
	// Push by digest -- should get same result
 | 
			
		||||
	resp = putManifest(t, "putting signed manifest", manifestDigestURL, signedManifest)
 | 
			
		||||
	checkResponse(t, "putting signed manifest", resp, http.StatusAccepted)
 | 
			
		||||
	checkResponse(t, "putting signed manifest", resp, http.StatusCreated)
 | 
			
		||||
	checkHeaders(t, resp, http.Header{
 | 
			
		||||
		"Location":              []string{manifestDigestURL},
 | 
			
		||||
		"Docker-Content-Digest": []string{dgst.String()},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -183,7 +183,7 @@ func (imh *imageManifestHandler) PutImageManifest(w http.ResponseWriter, r *http
 | 
			
		|||
 | 
			
		||||
	w.Header().Set("Location", location)
 | 
			
		||||
	w.Header().Set("Docker-Content-Digest", imh.Digest.String())
 | 
			
		||||
	w.WriteHeader(http.StatusAccepted)
 | 
			
		||||
	w.WriteHeader(http.StatusCreated)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DeleteImageManifest removes the image with the given tag from the registry.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue