code: func (ts *tagStore) Lookup(ctx context.Context, desc distribution.Descriptor) ([]string, error) {
  	allTags, err := ts.All(ctx)
  	switch err.(type) {
  	case distribution.ErrRepositoryUnknown:
  		// This tag store has been initialized but not yet populated
  		break
  	case nil:
  		break
  	default:
  		return nil, err
  	}
  
  	var tags []string
  	for _, tag := range allTags {
  		tagLinkPathSpec := manifestTagCurrentPathSpec{
  			name: ts.repository.Named().Name(),
  			tag:  tag,
  		}
  
  		tagLinkPath, _ := pathFor(tagLinkPathSpec)
  		tagDigest, err := ts.blobStore.readlink(ctx, tagLinkPath)
  		if err != nil {
  			switch err.(type) {
  			case storagedriver.PathNotFoundError:
  				continue
  			}
  			return nil, err
  		}
  
  		if tagDigest == desc.Digest {
  			tags = append(tags, tag)
  		}
  	}
  
  	return tags, nil
  }
docs: // Lookup recovers a list of tags which refer to this digest.  When a manifest is deleted by
  // digest, tag entries which point to it need to be recovered to avoid dangling tags.