storage/storage_image.go
func (s *storageImageDestination) PutManifest(ctx context.Context, manifestBlob []byte) error {
	if s.imageRef.named != nil {
		if digested, ok := s.imageRef.named.(reference.Digested); ok {
			matches, err := manifest.MatchesDigest(manifestBlob, digested.Digest())
			if err != nil {
				return err
			}
			if !matches {
				return fmt.Errorf("Manifest does not match expected digest %s", digested.Digest())
			}
		}
	}

	s.manifest = make([]byte, len(manifestBlob))
	copy(s.manifest, manifestBlob)
	return nil
}
func (s *storageImageDestination) PutManifest(ctx context.Context, manifestBlob []byte) error {
	if s.imageRef.named != nil {
		if digested, ok := s.imageRef.named.(reference.Digested); ok {
			matches, err := manifest.MatchesDigest(manifestBlob, digested.Digest())
			if err != nil {
				return err
			}
			if !matches {
				return fmt.Errorf("Manifest does not match expected digest %s", digested.Digest())
			}
		}
	}

	s.manifest = make([]byte, len(manifestBlob))
	copy(s.manifest, manifestBlob)
	return nil
}
// PutManifest writes the manifest to the destination.