Merge pull request #45822 from thaJeztah/24.0_backport_containerd-from-scratch

[24.0 backport] Skip cache lookup for "FROM scratch" in containerd
This commit is contained in:
Sebastiaan van Stijn 2023-06-27 14:14:50 +02:00 committed by GitHub
commit 4735ce7ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,12 @@ type imageCache struct {
func (ic *imageCache) GetCache(parentID string, cfg *container.Config) (imageID string, err error) {
ctx := context.TODO()
if parentID == "" {
// TODO handle "parentless" image cache lookups ("FROM scratch")
return "", nil
}
parent, err := ic.c.GetImage(ctx, parentID, imagetype.GetImageOpts{})
if err != nil {
return "", err