mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 01:53:42 +08:00 
			
		
		
		
	avoid extra client for history API detection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
		@@ -88,18 +88,11 @@ func (d *Driver) Client(ctx context.Context) (*client.Client, error) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (d *Driver) Features(ctx context.Context) map[driver.Feature]bool {
 | 
			
		||||
	var historyAPI bool
 | 
			
		||||
	c, err := d.Client(ctx)
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		historyAPI = driver.HistoryAPISupported(ctx, c)
 | 
			
		||||
		c.Close()
 | 
			
		||||
	}
 | 
			
		||||
	return map[driver.Feature]bool{
 | 
			
		||||
		driver.OCIExporter:    true,
 | 
			
		||||
		driver.DockerExporter: true,
 | 
			
		||||
		driver.CacheExport:    true,
 | 
			
		||||
		driver.MultiPlatform:  true,
 | 
			
		||||
		driver.HistoryAPI:     historyAPI,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user