code: func (r *Session) PushImageChecksumRegistry(imgData *ImgData, registry string) error {
  	u := registry + "images/" + imgData.ID + "/checksum"
  
  	logrus.Debugf("[registry] Calling PUT %s", u)
  
  	req, err := http.NewRequest("PUT", u, nil)
  	if err != nil {
  		return err
  	}
  	req.Header.Set("X-Docker-Checksum", imgData.Checksum)
  	req.Header.Set("X-Docker-Checksum-Payload", imgData.ChecksumPayload)
  
  	res, err := r.client.Do(req)
  	if err != nil {
  		return fmt.Errorf("Failed to upload metadata: %v", err)
  	}
  	defer res.Body.Close()
  	if len(res.Cookies()) > 0 {
  		r.client.Jar.SetCookies(req.URL, res.Cookies())
  	}
  	if res.StatusCode != 200 {
  		errBody, err := ioutil.ReadAll(res.Body)
  		if err != nil {
  			return fmt.Errorf("HTTP code %d while uploading metadata and error when trying to parse response body: %s", res.StatusCode, err)
  		}
  		var jsonBody map[string]string
  		if err := json.Unmarshal(errBody, &jsonBody); err != nil {
  			errBody = []byte(err.Error())
  		} else if jsonBody["error"] == "Image already exists" {
  			return ErrAlreadyExists
  		}
  		return fmt.Errorf("HTTP code %d while uploading metadata: %q", res.StatusCode, errBody)
  	}
  	return nil
  }
docs: // PushImageChecksumRegistry uploads checksums for an image