feat(storage): Add support for content-types (GCS only)
Extends storage.Persist to accept a Content-Type argument, which in the GCS backend is persisted with the object to ensure that the object is served back with this content-type. This is not yet implemented for the filesystem backend, where the parameter is simply ignored. This should help in the case of clients which expect the returned objects to have content-types set when, for example, fetching layers by digest.
This commit is contained in:
parent
8a5c446bab
commit
cc35bf0fc3
7 changed files with 34 additions and 13 deletions
|
|
@ -36,7 +36,7 @@ type Backend interface {
|
|||
// It needs to return the SHA256 hash of the data written as
|
||||
// well as the total number of bytes, as those are required
|
||||
// for the image manifest.
|
||||
Persist(context.Context, string, Persister) (string, int64, error)
|
||||
Persist(ctx context.Context, path, contentType string, f Persister) (string, int64, error)
|
||||
|
||||
// Fetch retrieves data from the storage backend.
|
||||
Fetch(ctx context.Context, path string) (io.ReadCloser, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue