func PutManifestDescriptorToIndex(img string, desc *spec.Descriptor) error {
	refName, ok := desc.Annotations[RefNameAnnotation]
	if ok && refName != "" {
		if err := RemoveManifestDescriptorFromIndex(img, refName); err != nil {
			return err
		}
	}
	idx, err := ReadIndex(img)
	if err != nil {
		return err
	}
	idx.Manifests = append(idx.Manifests, *desc)
	return WriteIndex(img, idx)
}
// PutManifestDescriptorToIndex puts a manifest descriptor to the index.
// If ref name is set and conflicts with the existing descriptors, the old ones are removed.
PutManifestDescriptorToIndex puts a manifest descriptor to the index.
If ref name is set and conflicts with the existing descriptors, the old ones are removed.
// PutManifestDescriptorToIndex puts a manifest descriptor to the index . // If ref name is set and conflicts with the existing descriptors the old ones are removed .
func PutManifestDescriptorToIndex(img string, desc *spec.Descriptor) error {
	refName, ok := desc.Annotations[RefNameAnnotation]
	if ok && refName != "" {
		if err := RemoveManifestDescriptorFromIndex(img, refName); err != nil {
			return err
		}
	}
	idx, err := ReadIndex(img)
	if err != nil {
		return err
	}
	idx.Manifests = append(idx.Manifests, *desc)
	return WriteIndex(img, idx)
}
func PutManifestDescriptorToIndex ( img string , desc * spec . Descriptor ) error { refName , ok := desc . Annotations [ RefNameAnnotation ] if ok && refName != " " { if err := RemoveManifestDescriptorFromIndex ( img , refName ) ; err != nil { return err } } idx , err := ReadIndex ( img ) if err != nil { return err } idx . Manifests = append ( idx . Manifests , * desc ) return WriteIndex ( img , idx ) }
PutManifestDescriptorToIndex puts a manifest descriptor to the index.
PutManifestDescriptorToIndex puts a manifest descriptor to the index .