Implement immutable manifest reference support
This changeset implements immutable manifest references via the HTTP API. Most of the changes follow from modifications to ManifestService. Once updates were made across the repo to implement these changes, the http handlers were change accordingly. The new methods on ManifestService will be broken out into a tagging service in a later PR. Unfortunately, due to complexities around managing the manifest tag index in an eventually consistent manner, direct deletes of manifests have been disabled. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
f536633ca8
commit
40273b1d36
15 changed files with 387 additions and 128 deletions
|
@ -67,8 +67,8 @@ type manifestServiceListener struct {
|
|||
parent *repositoryListener
|
||||
}
|
||||
|
||||
func (msl *manifestServiceListener) Get(tag string) (*manifest.SignedManifest, error) {
|
||||
sm, err := msl.ManifestService.Get(tag)
|
||||
func (msl *manifestServiceListener) Get(dgst digest.Digest) (*manifest.SignedManifest, error) {
|
||||
sm, err := msl.ManifestService.Get(dgst)
|
||||
if err == nil {
|
||||
if err := msl.parent.listener.ManifestPulled(msl.parent.Repository, sm); err != nil {
|
||||
logrus.Errorf("error dispatching manifest pull to listener: %v", err)
|
||||
|
@ -78,8 +78,8 @@ func (msl *manifestServiceListener) Get(tag string) (*manifest.SignedManifest, e
|
|||
return sm, err
|
||||
}
|
||||
|
||||
func (msl *manifestServiceListener) Put(tag string, sm *manifest.SignedManifest) error {
|
||||
err := msl.ManifestService.Put(tag, sm)
|
||||
func (msl *manifestServiceListener) Put(sm *manifest.SignedManifest) error {
|
||||
err := msl.ManifestService.Put(sm)
|
||||
|
||||
if err == nil {
|
||||
if err := msl.parent.listener.ManifestPushed(msl.parent.Repository, sm); err != nil {
|
||||
|
@ -90,6 +90,17 @@ func (msl *manifestServiceListener) Put(tag string, sm *manifest.SignedManifest)
|
|||
return err
|
||||
}
|
||||
|
||||
func (msl *manifestServiceListener) GetByTag(tag string) (*manifest.SignedManifest, error) {
|
||||
sm, err := msl.ManifestService.GetByTag(tag)
|
||||
if err == nil {
|
||||
if err := msl.parent.listener.ManifestPulled(msl.parent.Repository, sm); err != nil {
|
||||
logrus.Errorf("error dispatching manifest pull to listener: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return sm, err
|
||||
}
|
||||
|
||||
type layerServiceListener struct {
|
||||
distribution.LayerService
|
||||
parent *repositoryListener
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue