mirror of https://github.com/docker/buildx.git
				
				
				
			Address feedback
Signed-off-by: Felix de Souza <fdesouza@palantir.com>
This commit is contained in:
		
							parent
							
								
									83a09b3cf2
								
							
						
					
					
						commit
						b68114375f
					
				|  | @ -113,8 +113,9 @@ func (p *Printer) Print(raw bool, out io.Writer) error { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	imageconfigs := make(map[string]*ocispecs.Image) | 	imageconfigs := make(map[string]*ocispecs.Image) | ||||||
|  | 	imageconfigsMutex := sync.Mutex{} | ||||||
| 	buildinfos := make(map[string]*binfotypes.BuildInfo) | 	buildinfos := make(map[string]*binfotypes.BuildInfo) | ||||||
| 	mutex := &sync.RWMutex{} | 	buildinfosMutex := sync.Mutex{} | ||||||
| 
 | 
 | ||||||
| 	eg, _ := errgroup.WithContext(p.ctx) | 	eg, _ := errgroup.WithContext(p.ctx) | ||||||
| 	for _, platform := range p.platforms { | 	for _, platform := range p.platforms { | ||||||
|  | @ -124,16 +125,16 @@ func (p *Printer) Print(raw bool, out io.Writer) error { | ||||||
| 				if err != nil { | 				if err != nil { | ||||||
| 					return err | 					return err | ||||||
| 				} else if img != nil { | 				} else if img != nil { | ||||||
| 					mutex.Lock() | 					imageconfigsMutex.Lock() | ||||||
| 					imageconfigs[platforms.Format(platform)] = img | 					imageconfigs[platforms.Format(platform)] = img | ||||||
| 					mutex.Unlock() | 					imageconfigsMutex.Unlock() | ||||||
| 				} | 				} | ||||||
| 				if bi, err := imageutil.BuildInfo(dtic); err != nil { | 				if bi, err := imageutil.BuildInfo(dtic); err != nil { | ||||||
| 					return err | 					return err | ||||||
| 				} else if bi != nil { | 				} else if bi != nil { | ||||||
| 					mutex.Lock() | 					buildinfosMutex.Lock() | ||||||
| 					buildinfos[platforms.Format(platform)] = bi | 					buildinfos[platforms.Format(platform)] = bi | ||||||
| 					mutex.Unlock() | 					buildinfosMutex.Unlock() | ||||||
| 				} | 				} | ||||||
| 				return nil | 				return nil | ||||||
| 			}) | 			}) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue