Merge pull request #41301 from wangyumu/fix-buildkit-pull-nil-panic

fix buildkit nil panic when frontend image exists
This commit is contained in:
Sebastiaan van Stijn 2020-07-31 21:24:09 +02:00 committed by GitHub
commit 39691204f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ func (is *Source) ResolveImageConfig(ctx context.Context, ref string, opt llb.Re
case source.ResolveModePreferLocal:
img, err := is.resolveLocal(ref)
if err == nil {
if !platformMatches(img, opt.Platform) {
if opt.Platform != nil && !platformMatches(img, opt.Platform) {
logrus.WithField("ref", ref).Debugf("Requested build platform %s does not match local image platform %s, checking remote",
path.Join(opt.Platform.OS, opt.Platform.Architecture, opt.Platform.Variant),
path.Join(img.OS, img.Architecture, img.Variant),