Allow Manifest Service to be configured with function arguments
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
This commit is contained in:
parent
b318e01f7d
commit
cd31d466e4
7 changed files with 103 additions and 41 deletions
|
@ -50,13 +50,13 @@ type imageManifestHandler struct {
|
|||
// GetImageManifest fetches the image manifest from the storage backend, if it exists.
|
||||
func (imh *imageManifestHandler) GetImageManifest(w http.ResponseWriter, r *http.Request) {
|
||||
ctxu.GetLogger(imh).Debug("GetImageManifest")
|
||||
manifests := imh.Repository.Manifests()
|
||||
|
||||
var (
|
||||
sm *manifest.SignedManifest
|
||||
err error
|
||||
)
|
||||
manifests, err := imh.Repository.Manifests(imh)
|
||||
if err != nil {
|
||||
imh.Errors = append(imh.Errors, err)
|
||||
return
|
||||
}
|
||||
|
||||
var sm *manifest.SignedManifest
|
||||
if imh.Tag != "" {
|
||||
sm, err = manifests.GetByTag(imh.Tag)
|
||||
} else {
|
||||
|
@ -106,7 +106,12 @@ func etagMatch(r *http.Request, etag string) bool {
|
|||
// PutImageManifest validates and stores and image in the registry.
|
||||
func (imh *imageManifestHandler) PutImageManifest(w http.ResponseWriter, r *http.Request) {
|
||||
ctxu.GetLogger(imh).Debug("PutImageManifest")
|
||||
manifests := imh.Repository.Manifests()
|
||||
manifests, err := imh.Repository.Manifests(imh)
|
||||
if err != nil {
|
||||
imh.Errors = append(imh.Errors, err)
|
||||
return
|
||||
}
|
||||
|
||||
dec := json.NewDecoder(r.Body)
|
||||
|
||||
var manifest manifest.SignedManifest
|
||||
|
|
|
@ -34,7 +34,11 @@ type tagsAPIResponse struct {
|
|||
// GetTags returns a json list of tags for a specific image name.
|
||||
func (th *tagsHandler) GetTags(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
manifests := th.Repository.Manifests()
|
||||
manifests, err := th.Repository.Manifests(th)
|
||||
if err != nil {
|
||||
th.Errors = append(th.Errors, err)
|
||||
return
|
||||
}
|
||||
|
||||
tags, err := manifests.Tags()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue