mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
feat: add support for docker images (#2714)
* feat: add support for docker images Issue #724 A new config section under "HTTP" called "Compat" is added which currently takes a list of possible compatible legacy media-types. https://github.com/opencontainers/image-spec/blob/main/media-types.md#compatibility-matrix Only "docker2s2" (Docker Manifest V2 Schema V2) is currently supported. Garbage collection also needs to be made aware of non-OCI compatible layer types. feat: add cve support for non-OCI compatible layer types Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com> * Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com> * test: add more docker compat tests Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com> * feat: add additional validation checks for non-OCI images Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com> * ci: make "full" images docker-compatible Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com> --------- Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
GitHub
parent
403fd4eb61
commit
cb2af94b0b
@@ -954,7 +954,7 @@ func TestCookiestoreCleanup(t *testing.T) {
|
||||
err = os.Chtimes(sessionPath, changeTime, changeTime)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
imgStore := local.NewImageStore(rootDir, false, false, log, metrics, nil, nil)
|
||||
imgStore := local.NewImageStore(rootDir, false, false, log, metrics, nil, nil, nil)
|
||||
|
||||
storeController := storage.StoreController{
|
||||
DefaultStore: imgStore,
|
||||
@@ -989,7 +989,7 @@ func TestCookiestoreCleanup(t *testing.T) {
|
||||
err = os.WriteFile(sessionPath, []byte("session"), storageConstants.DefaultFilePerms)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
imgStore := local.NewImageStore(rootDir, false, false, log, metrics, nil, nil)
|
||||
imgStore := local.NewImageStore(rootDir, false, false, log, metrics, nil, nil, nil)
|
||||
|
||||
storeController := storage.StoreController{
|
||||
DefaultStore: imgStore,
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
distspec "github.com/opencontainers/distribution-spec/specs-go"
|
||||
|
||||
"zotregistry.dev/zot/pkg/compat"
|
||||
extconf "zotregistry.dev/zot/pkg/extensions/config"
|
||||
storageConstants "zotregistry.dev/zot/pkg/storage/constants"
|
||||
)
|
||||
@@ -122,7 +123,8 @@ type HTTPConfig struct {
|
||||
Auth *AuthConfig
|
||||
AccessControl *AccessControlConfig `mapstructure:"accessControl,omitempty"`
|
||||
Realm string
|
||||
Ratelimit *RatelimitConfig `mapstructure:",omitempty"`
|
||||
Ratelimit *RatelimitConfig `mapstructure:",omitempty"`
|
||||
Compat []compat.MediaCompatibility `mapstructure:",omitempty"`
|
||||
}
|
||||
|
||||
type SchedulerConfig struct {
|
||||
|
||||
+1
-1
@@ -688,7 +688,7 @@ func (rh *RouteHandler) UpdateManifest(response http.ResponseWriter, request *ht
|
||||
}
|
||||
|
||||
mediaType := request.Header.Get("Content-Type")
|
||||
if !storageCommon.IsSupportedMediaType(mediaType) {
|
||||
if !storageCommon.IsSupportedMediaType(rh.c.Config.HTTP.Compat, mediaType) {
|
||||
err := apiErr.NewError(apiErr.MANIFEST_INVALID).AddDetail(map[string]string{"mediaType": mediaType})
|
||||
zcommon.WriteJSON(response, http.StatusUnsupportedMediaType, apiErr.NewErrorList(err))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user