app/imageoper: index only for OCI manifests
This commit is contained in:
@@ -33,14 +33,6 @@ type PutManifestResult struct {
|
||||
Location string
|
||||
}
|
||||
|
||||
const (
|
||||
ddmMimeType = "application/vnd.docker.distribution.manifest.v2+json"
|
||||
oimMimeType = "application/vnd.oci.image.manifest.v1+json"
|
||||
|
||||
XXXoicMimeType = "application/vnd.oci.image.config.v1+json"
|
||||
XXXdciMimeType = "application/vnd.docker.container.image.v1+json"
|
||||
)
|
||||
|
||||
// TODO: lock for the name-reference or simular?
|
||||
func (oper *Operator) PutManifest(ctx context.Context, params *PutManifestParams) (*PutManifestResult, int, error) {
|
||||
var err error
|
||||
@@ -55,7 +47,7 @@ func (oper *Operator) PutManifest(ctx context.Context, params *PutManifestParams
|
||||
return res, http.StatusBadRequest, err
|
||||
}
|
||||
// Check Content-Type
|
||||
if params.ContentType != oimMimeType && params.ContentType != ddmMimeType {
|
||||
if params.ContentType != oimMediaType && params.ContentType != ddmMediaType {
|
||||
err = fmt.Errorf("Unknown or empty Content-Type: %s", params.ContentType)
|
||||
return res, http.StatusNotFound, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user