Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pluggable blob storage for pkg/registry (#1209)
* Pluggable blob storage for pkg/registry Features: - supports redirects if the blob handler hosts blobs elsewhere. - supports automatically verifying digests/sizes if possible, transparent to the blob handler (if they want it to be). - repo strings passed to blobHandler methods aren't name.Repository, but should be easily parsed by implementations if they want that. This is still hidden in unexported interfaces and always uses memHandler for now, while we iterate on the shape we want these things to take. Longer term, we should also extend this to manifest and upload storage, using similar interfaces. * Move blob access locks into memHandler * pass context, unexport errors * - split blobHandler into extensible interfaces - if the provided handler supports Stat, we use it; otherwise fallback to Get - if the provided handler doesn't support Put, the registry is read-only - better registry error handling - reused vars (less verbose) - renamed errTODO(string) -> regErrInternal(err) - added response body check to test cases - checking verify.ReadCloser errors, verification is broken somehow (working on it) * Fix verify.ReadCloser when size is unknown 🤦 * handle redirects for Stat, and fallback-Get on HEAD * do type checks inline
- Loading branch information