Adds options map for storagedriver URLFor() method

This commit is contained in:
Brian Bland 2015-01-08 17:10:32 -08:00
parent 17915e1b01
commit abb901e4ab
7 changed files with 22 additions and 10 deletions

View file

@ -90,7 +90,7 @@ func (lh *cloudFrontLayerHandler) Resolve(layer Layer) (http.Handler, error) {
return nil, err
}
cfURL, err := lh.cloudfront.CannedSignedURL(layerURL.Path, "", time.Now().Add(time.Minute))
cfURL, err := lh.cloudfront.CannedSignedURL(layerURL.Path, "", time.Now().Add(20*time.Minute))
if err != nil {
return nil, err
}

View file

@ -2,6 +2,7 @@ package storage
import (
"net/http"
"time"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storagedriver"
@ -42,7 +43,7 @@ func (lh *delegateLayerHandler) urlFor(layer Layer) (string, error) {
return "", err
}
layerURL, err := lh.storageDriver.URLFor(blobPath)
layerURL, err := lh.storageDriver.URLFor(blobPath, map[string]interface{}{"expires": time.Now().Add(20 * time.Minute)})
if err != nil {
return "", err
}