Skip to content

Commit b8ed78f

Browse files
authored
Merge pull request #5966 from tonistiigi/image-manifest-err-fix
cache: improve migration to image manifest cache
2 parents 5ecb410 + b40bfd1 commit b8ed78f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

cache/remotecache/export.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func NewExportableCache(oci bool, imageManifest bool) (*ExportableCache, error)
8383
if imageManifest {
8484
mediaType = ocispecs.MediaTypeImageManifest
8585
if !oci {
86-
return nil, errors.Errorf("invalid configuration for remote cache")
86+
return nil, errors.Errorf("invalid configuration for remote cache, OCI mediatypes are required for image-manifest cache format")
8787
}
8888
} else {
8989
if oci {

cache/remotecache/local/local.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ func ResolveCacheExporterFunc(sm *session.Manager) remotecache.ResolveCacheExpor
5858
return nil, errors.Wrapf(err, "failed to parse %s", attrImageManifest)
5959
}
6060
imageManifest = b
61+
} else if !ociMediatypes {
62+
imageManifest = false
6163
}
64+
6265
csID := contentStoreIDPrefix + store
6366
cs, err := getContentStore(ctx, sm, g, csID)
6467
if err != nil {

cache/remotecache/registry/registry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ func ResolveCacheExporterFunc(sm *session.Manager, hosts docker.RegistryHosts) r
7676
return nil, errors.Wrapf(err, "failed to parse %s", attrImageManifest)
7777
}
7878
imageManifest = b
79+
} else if !ociMediatypes {
80+
imageManifest = false
7981
}
8082
insecure := false
8183
if v, ok := attrs[attrInsecure]; ok {

0 commit comments

Comments
 (0)