Skip to content

Commit

Permalink
Merge pull request #4157 from jedevc/fix-provenance-bridge-race
Browse files Browse the repository at this point in the history
solver: fix possible race for provenance ResolveImageConfig
  • Loading branch information
tonistiigi authored Aug 17, 2023
2 parents 7f02969 + c08f767 commit 81cd697
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions solver/llbsolver/provenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ func (b *provenanceBridge) ResolveImageConfig(ctx context.Context, ref string, o
return "", "", nil, err
}

b.mu.Lock()
b.images = append(b.images, provenance.ImageSource{
Ref: ref,
Platform: opt.Platform,
Digest: dgst,
Local: opt.ResolverType == llb.ResolverTypeOCILayout,
})
b.mu.Unlock()
return ref, dgst, config, nil
}

Expand Down

0 comments on commit 81cd697

Please sign in to comment.