Skip to content

Commit

Permalink
Merge branch 'vbatts-v2_hacking' of github.com:vbatts/docker into vba…
Browse files Browse the repository at this point in the history
…tts-v2_hacking
  • Loading branch information
vbatts committed Aug 29, 2014
2 parents e63f287 + 7e1354d commit afaf7f1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions registry/session_prov.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// APIVersion2 /v2/
var v2HTTPRoutes = routes.NewRegistryRouter()

func getV2URL(e Endpoint, routeName string, vars map[string]string) (*url.URL, error) {
func getV2URL(e *Endpoint, routeName string, vars map[string]string) (*url.URL, error) {
route := v2HTTPRoutes.Get(routeName)
if route == nil {
return nil, fmt.Errorf("unknown regisry v2 route name: %q", routeName)
Expand All @@ -36,7 +36,7 @@ func getV2URL(e Endpoint, routeName string, vars map[string]string) (*url.URL, e
Scheme: e.URL.Scheme,
Host: e.URL.Host,
Path: routePath.Path,
}
}, nil
}

// V2 Provenance POC
Expand All @@ -52,7 +52,6 @@ func (r *Session) GetV2Version(token []string) (*RegistryInfo, error) {
}

method := "GET"
hr := v2HTTPRoutes[method]["Version"]
log.Printf("[registry] Calling %q %s", method, routeURL.String())

req, err := r.reqFactory.NewRequest(method, routeURL.String(), nil)
Expand Down Expand Up @@ -141,7 +140,7 @@ func (r *Session) PostV2ImageMountBlob(imageName, sumType, sum string, token []s

routeURL, err := getV2URL(r.indexEndpoint, routes.MountBlobRouteName, vars)
if err != nil {
return nil, err
return false, err
}

method := "POST"
Expand Down Expand Up @@ -183,7 +182,7 @@ func (r *Session) PutV2ImageBlob(imageName, sumType string, blobRdr io.Reader, t

routeURL, err := getV2URL(r.indexEndpoint, routes.UploadBlobRouteName, vars)
if err != nil {
return nil, err
return "", err
}

method := "PUT"
Expand Down Expand Up @@ -234,7 +233,7 @@ func (r *Session) PutV2ImageManifest(imageName, tagName string, manifestRdr io.R

routeURL, err := getV2URL(r.indexEndpoint, routes.ManifestsRouteName, vars)
if err != nil {
return nil, err
return err
}

method := "PUT"
Expand Down

0 comments on commit afaf7f1

Please sign in to comment.