If referrer API not supported and referrers need to be updated, oras-go will 1) update the referrer index and 2) cleanup the dangling one.
|
// 4. delete the dangling original referrers index |
|
if !skipDelete { |
|
if err := s.repo.delete(ctx, oldIndexDesc, true); err != nil { |
|
return fmt.Errorf("failed to delete dangling referrers index %s for referrers tag %s: %w", oldIndexDesc.Digest.String(), referrersTag, err) |
|
} |
|
} |
It would be great if oras-go can expose a certain typed error when the cleanup operation fails, so caller client can decide whether to terminate, or ignore the error, or do ad-hoc garbage collection on caller side.
If referrer API not supported and referrers need to be updated, oras-go will 1) update the referrer index and 2) cleanup the dangling one.
oras-go/registry/remote/repository.go
Lines 1271 to 1276 in 336b9fb
It would be great if oras-go can expose a certain typed error when the cleanup operation fails, so caller client can decide whether to terminate, or ignore the error, or do ad-hoc garbage collection on caller side.