Mirror writes to database: Manifests DELETE Handler

Context

This issue is meant to investigate steps which are required to mirror metadata writes generated from calls the Manifests PUT Handler.

Affected Route(s)

DELETE /v2/<name>/manifests/<reference>

API Reference

Detailed Handler Operations.

  1. Instantiate a distribution.ManifestService, the concrete type is a storage.manifestStore
  2. Call distribution.ManifestService.Delete(ctx, digest.Digest) using the digest from the manifestHandler`
    1. Call storage.manifestStore.blobStore.Delete(ctx, digest.Digest), concrete type is storeage.linkedBlobStore
      1. Return error if deletion is not supported
      2. call storeage.linkedBlobStore.blobAccessController.Clear(ctx, digest.Digest), concrete type is (probably) storage.linkedBlobStatter
        1. range over storeage.linkedBlobStatter.linkPathFns there are manifestRevisionLinkPath (<root>/v2/repositories/<name>/_manifests/revisions/<algorithm>/<hex digest>/link) and blobLinkPath (<root>/v2/repositories/<name>/_layers/<algorithm>/<hex digest>/link) ref
          1. call driver.StorageDriver.Delete on both paths, ignoring driver.PathNotFoundError
  3. Instantiate a distribution.TagService, the concrete type is a storage.tagStore
  4. call distribution.TagService.Lookup(ctx, distribution.Descriptor{Digest: imh.Digest}) to get referencedTags
  5. range over tag in referencedTags
    1. call distribution.TagService.Untag(ctx, tag)
      1. get the manifestTagPathSpec for the tag (<root>/v2/repositories/<name>/_manifests/tags/<tag>/)
      2. call driver.StorageDriver.Delete(ctx, manifestTagPathSpec)
      3. append any errors into manifestHandler.Errors
  6. call http.ResponseWriter.WriteHeader(http.StatusAccepted)
Edited by Hayley Swimelar