extend blobhandler context/registration with artifact type #170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
A blob handler is responsible for storing local blobs in an alternate way.
For example, in a OCI registry backend for OCM repositories, local blobs describing an OCI artifact are exploded and stored as regular OCI artifacts, again. The access spec in the CD is adapted accordingly.
Therefore a blob handler gets a storage context describing the technical target repository and the blob (including its mime type). It then decides whether it will handle the blob or not. If yes, it has to return an appropriate access spec usable to access the content.
Similar is the registration, handlers are registered for implementation repositories types and mime types.
Both is optional. Even if a registration constraint matches, the handler may reject the handling of a given blob.
To solve this all matching handler are called in a prioritized order until a handler feels responsible.
All this is sufficient, to support backing technologies to provide appropriate blobs in their native formats (like the OCI artifacts) if transported content reaches it.
To support more specific handlers with the plugin concept, it would be useful to support matches for dedicated artifact types, also. This would enable automatically upload imported content directly to intended target repositories (not equal to the OCM repository) (for example a maven repo GAV content could be propagated to a local Maven repository. This is introduced with this PR, in preparation for the connections with plugins.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: