Signed-off-by: Tibor Vass <tibor@docker.com>
| ... | ... |
@@ -93,7 +93,13 @@ func (is *Source) resolveRemote(ctx context.Context, ref string, platform *ocisp |
| 93 | 93 |
dgst digest.Digest |
| 94 | 94 |
dt []byte |
| 95 | 95 |
} |
| 96 |
- res, err := is.g.Do(ctx, ref, func(ctx context.Context) (interface{}, error) {
|
|
| 96 |
+ p := platforms.DefaultSpec() |
|
| 97 |
+ if platform != nil {
|
|
| 98 |
+ p = *platform |
|
| 99 |
+ } |
|
| 100 |
+ // key is used to synchronize resolutions that can happen in parallel when doing multi-stage. |
|
| 101 |
+ key := "getconfig::" + ref + "::" + platforms.Format(p) |
|
| 102 |
+ res, err := is.g.Do(ctx, key, func(ctx context.Context) (interface{}, error) {
|
|
| 97 | 103 |
res := resolver.DefaultPool.GetResolver(is.RegistryHosts, ref, "pull", sm, g) |
| 98 | 104 |
dgst, dt, err := imageutil.Config(ctx, ref, res, is.ContentStore, nil, platform) |
| 99 | 105 |
if err != nil {
|
| ... | ... |
@@ -247,7 +253,9 @@ func (p *puller) resolveLocal() {
|
| 247 | 247 |
} |
| 248 | 248 |
|
| 249 | 249 |
func (p *puller) resolve(ctx context.Context, g session.Group) error {
|
| 250 |
- _, err := p.is.g.Do(ctx, "", func(ctx context.Context) (_ interface{}, err error) {
|
|
| 250 |
+ // key is used to synchronize resolutions that can happen in parallel when doing multi-stage. |
|
| 251 |
+ key := "resolve::" + p.ref + "::" + platforms.Format(p.platform) |
|
| 252 |
+ _, err := p.is.g.Do(ctx, key, func(ctx context.Context) (_ interface{}, err error) {
|
|
| 251 | 253 |
resolveProgressDone := oneOffProgress(ctx, "resolve "+p.src.Reference.String()) |
| 252 | 254 |
defer func() {
|
| 253 | 255 |
resolveProgressDone(err) |