Merge pull request #42382 from thaJeztah/20.10_backport_schema1_cache_fix

[20.10 backport] builder-next: relax second cache key requirements for schema1
This commit is contained in:
Brian Goff 2021-05-20 12:08:53 -07:00 committed by GitHub
commit 3db8385b18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -333,12 +333,12 @@ func (p *puller) CacheKey(ctx context.Context, g session.Group, index int) (stri
return dgst.String(), nil, false, nil
}
if len(p.config) == 0 {
if len(p.config) == 0 && p.desc.MediaType != images.MediaTypeDockerSchema1Manifest {
return "", nil, false, errors.Errorf("invalid empty config file resolved for %s", p.src.Reference.String())
}
k := cacheKeyFromConfig(p.config).String()
if k == "" {
if k == "" || p.desc.MediaType == images.MediaTypeDockerSchema1Manifest {
dgst, err := p.mainManifestKey(p.platform)
if err != nil {
return "", nil, false, err